forked from stripe/stripe-terminal-react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
StripeTerminalReactNativeModule reduced scope (stripe#202)
* separated callbacks and listeners from RN module * cancelOperation added * ReactNativeConstants imports * extracting reader.serialNumber
- Loading branch information
1 parent
31a61e8
commit 2d03a3b
Showing
16 changed files
with
705 additions
and
652 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
android/src/main/java/com/stripeterminalreactnative/ReactExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.stripeterminalreactnative | ||
|
||
import com.facebook.react.bridge.ReactApplicationContext | ||
import com.facebook.react.bridge.WritableNativeMap | ||
import com.facebook.react.modules.core.DeviceEventManagerModule | ||
|
||
internal object ReactExtensions { | ||
|
||
fun ReactApplicationContext.sendEvent( | ||
eventName: String, | ||
resultBuilder: WritableNativeMap.() -> Unit | ||
) { | ||
getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java) | ||
.emit(eventName, nativeMapOf { | ||
resultBuilder() | ||
}) | ||
} | ||
} |
Oops, something went wrong.