Files
react-native/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js
T
Rubén NorteandFacebook GitHub Bot fa406ac2aa Implement typed event emitters
Summary:
Adds types to Event Emitters and migrates the most relevant modules using them in `react-native`.

The most relevant file of this diff is `react-native/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js` with the Flow tests showing and testing the behavior of the new types

Changelog: [Internal] Add types for Event Emitters and subclasses

Reviewed By: motiz88

Differential Revision: D25587936

fbshipit-source-id: feeb09f9ad15d383cdd82deaaaba0d12b94e868b
2021-01-07 03:19:04 -08:00

26 lines
607 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.
*
* @format
* @flow
*/
'use strict';
import EventEmitter from '../../vendor/emitter/EventEmitter';
import RCTDeviceEventEmitter from '../RCTDeviceEventEmitter';
/**
* Mock the NativeEventEmitter as a normal JS EventEmitter.
*/
export default class NativeEventEmitter<
EventDefinitions: {...},
> extends EventEmitter<EventDefinitions> {
constructor() {
super(RCTDeviceEventEmitter.sharedSubscriber);
}
}