UNPKG

@rnw-community/react-native-payments

Version:

Accept Payments with Apple Pay and Android Pay using the Payment Request API.

13 lines 612 B
import { NativeEventEmitter } from 'react-native'; import { isDefined } from '@rnw-community/shared'; import { NativePayments } from '../../class/native-payments/native-payments.js'; let nativePaymentsEventEmitter = null; export const getNativePaymentsEventEmitter = () => { const { addListener, removeListeners } = NativePayments; if (!isDefined(addListener) || !isDefined(removeListeners)) { return null; } nativePaymentsEventEmitter ??= new NativeEventEmitter(NativePayments); return nativePaymentsEventEmitter; }; //# sourceMappingURL=get-native-payments-event-emitter.util.js.map