UNPKG

491 BPlain TextView Raw
1import { DeviceEventEmitter } from 'react-native';
2
3import { RCTEventEmitter } from './nativeEmitters';
4
5/**
6 * This emitter is used for sending synthetic native events to listeners
7 * registered in the API layer with `NativeEventEmitter`.
8 */
9class SyntheticPlatformEmitter {
10 _emitter = new RCTEventEmitter(DeviceEventEmitter.sharedSubscriber);
11
12 emit(eventName: string, props: any): void {
13 this._emitter.emit(eventName, props);
14 }
15}
16
17export default new SyntheticPlatformEmitter();