File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
package/android/src/newarch/com/margelo/rnnitrosqlite Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ package com.margelo.rnnitrosqlite
2+
3+ import com.facebook.react.bridge.Callback
4+ import com.facebook.react.bridge.ReactApplicationContext
5+ import com.margelo.rnnitrosqlite.NativeNitroSQLiteOnLoadSpec
6+
7+ class RNNitroSQLiteOnLoadModule (reactContext : ReactApplicationContext ) :
8+ NativeNitroSQLiteOnLoadSpec (reactContext) {
9+ private var reactApplicationContextReadyCallback: Callback ? = null
10+
11+ init {
12+ Companion .reactContext = reactContext
13+ DocPathSetter .setDocPath(reactContext)
14+
15+ if (reactApplicationContextReadyCallback != null ) {
16+ reactApplicationContextReadyCallback!! .invoke()
17+ }
18+ }
19+
20+ override fun getName (): String {
21+ return NAME
22+ }
23+
24+ override fun onReactApplicationContextReady (callback : Callback ) {
25+ if (reactContext != null ) {
26+ callback.invoke()
27+ return
28+ }
29+
30+ reactApplicationContextReadyCallback = callback
31+ }
32+
33+ companion object {
34+ const val NAME : String = " RNNitroSQLiteOnLoad"
35+
36+ var reactContext: ReactApplicationContext ? = null
37+ private set
38+ var reactApplicationContextReadyCallback: Callback ? = null
39+ private set
40+ }
41+ }
You can’t perform that action at this time.
0 commit comments