| 1234567891011121314151617181920 |
- import { DeviceEventEmitter } from 'react-native';
- export const EventKeys = {
- STORE_CHOOSE: 'STORE_CHOOSE',
- WEAL_REFRESH: 'WEAL_REFRESH',
- };
- export const emit = (event: string, data?: any) => {
- DeviceEventEmitter.emit(event, data);
- };
- export const on = (event: string, callback: (data?: any) => void) => {
- return DeviceEventEmitter.addListener(event, callback);
- };
- export default {
- emit,
- on,
- keys: EventKeys,
- };
|