react-native-xxhash 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/ios/Xxhash.mm +14 -10
  2. package/package.json +1 -1
package/ios/Xxhash.mm CHANGED
@@ -6,7 +6,7 @@
6
6
  #import <jsi/jsi.h>
7
7
 
8
8
  @implementation Xxhash
9
- RCT_EXPORT_MODULE()
9
+ RCT_EXPORT_MODULE(xxhash)
10
10
 
11
11
  @synthesize bridge = _bridge;
12
12
  @synthesize methodQueue = _methodQueue;
@@ -15,20 +15,24 @@ RCT_EXPORT_MODULE()
15
15
  return YES;
16
16
  }
17
17
 
18
+ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(install){
19
+ NSLog(@"Installing JSI bindings for xxhash ...");
20
+ RCTBridge* bridge = [RCTBridge currentBridge];
21
+ RCTCxxBridge* cxxBridge = (RCTCxxBridge*)bridge;
18
22
 
19
- - (void)setBridge:(RCTBridge *)bridge {
20
- _bridge = bridge;
23
+ if (cxxBridge == nil) {
24
+ return @false;
25
+ }
21
26
 
22
- RCTCxxBridge *cxxBridge = (RCTCxxBridge *)self.bridge;
23
- if (!cxxBridge.runtime) {
24
- return;
25
- }
27
+ auto jsiRuntime = (jsi::Runtime*) cxxBridge.runtime;
28
+ if (jsiRuntime == nil) {
29
+ return @false;
30
+ }
26
31
 
27
- auto jsiRuntime = (jsi::Runtime*)cxxBridge.runtime;
32
+ xxhash::install(jsiRuntime);
28
33
 
29
- xxhash::install(jsiRuntime);
34
+ return @true;
30
35
  }
31
36
 
32
37
 
33
-
34
38
  @end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-xxhash",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Fast xxHash implementation for React Native",
5
5
  "main": "./lib/commonjs/index.js",
6
6
  "module": "./lib/module/index.js",