This repository was archived by the owner on Mar 13, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-18
lines changed Expand file tree Collapse file tree 1 file changed +11
-18
lines changed Original file line number Diff line number Diff line change @@ -7,26 +7,19 @@ const LINKING_ERROR =
7
7
'- You rebuilt the app after installing the package\n' +
8
8
'- You are not using Expo managed workflow\n' ;
9
9
10
- const Sovran = NativeModules . Sovran
11
- ? NativeModules . Sovran
12
- : new Proxy (
13
- { } ,
14
- {
15
- get ( ) {
16
- throw new Error ( LINKING_ERROR ) ;
17
- } ,
18
- }
19
- ) ;
10
+ const Sovran = NativeModules . Sovran ;
11
+ if ( Sovran ) {
12
+ const { ON_STORE_ACTION } = Sovran . getConstants ( ) ;
20
13
21
- const { ON_STORE_ACTION } = Sovran . getConstants ( ) ;
22
-
23
- const SovranBridge = new NativeEventEmitter ( Sovran ) ;
24
-
25
- // Listen to Native events
26
- SovranBridge . addListener ( ON_STORE_ACTION , ( event ) => {
27
- onStoreAction ( event . type , event . payload ) ;
28
- } ) ;
14
+ const SovranBridge = new NativeEventEmitter ( Sovran ) ;
29
15
16
+ // Listen to Native events
17
+ SovranBridge . addListener ( ON_STORE_ACTION , ( event ) => {
18
+ onStoreAction ( event . type , event . payload ) ;
19
+ } ) ;
20
+ } else {
21
+ console . warn ( LINKING_ERROR ) ;
22
+ }
30
23
export { createStore , Store , Notify , Unsubscribe } from './store' ;
31
24
export { registerBridgeStore } from './bridge' ;
32
25
export * from './persistor' ;
You can’t perform that action at this time.
0 commit comments