1 | import { DeviceEventEmitter } from 'react-native';
|
2 |
|
3 | import { 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 | */
|
9 | class SyntheticPlatformEmitter {
|
10 | _emitter = new RCTEventEmitter(DeviceEventEmitter.sharedSubscriber);
|
11 |
|
12 | emit(eventName: string, props: any): void {
|
13 | this._emitter.emit(eventName, props);
|
14 | }
|
15 | }
|
16 |
|
17 | export default new SyntheticPlatformEmitter();
|