Files
react-native/Libraries/vendor/emitter/EventSubscription.js
T
Tim Yung 41b6884a1b RN: Implements EventSubscription
Summary:
Changes the to-be-legacy `_EventSubscription` and `_EmitterSubscription` classes to implement the event-agnostic `EventSubscription` interface.

This interface is valuable because it abstracts away the event definitions.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D26155911

fbshipit-source-id: f94280976d4f9219f4780ac8fae0d5fbc1865386
2021-02-01 17:50:22 -08:00

20 lines
487 B
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
'use strict';
// This exists as a separate file only to avoid circular dependencies from
// using this in `_EmitterSubscription`. Combine this back into `EventEmitter`
// after migration and cleanup is done.
export interface EventSubscription {
remove(): void;
}