File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed
Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change 11module . exports = {
2- presets : [ 'module:react-native-builder-bob/ babel-preset' ] ,
2+ presets : [ 'module:metro- react-native-babel-preset' ] ,
33} ;
Original file line number Diff line number Diff line change 66#import < jsi/jsi.h>
77
88@implementation Xxhash
9- RCT_EXPORT_MODULE ()
9+ RCT_EXPORT_MODULE (xxhash )
1010
1111@synthesize bridge = _bridge;
1212@synthesize methodQueue = _methodQueue;
@@ -15,20 +15,24 @@ + (BOOL)requiresMainQueueSetup {
1515 return YES ;
1616}
1717
18+ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD (install){
19+ NSLog (@" Installing JSI bindings for xxhash ..." );
20+ RCTBridge* bridge = [RCTBridge currentBridge ];
21+ RCTCxxBridge* cxxBridge = (RCTCxxBridge*)bridge;
1822
19- - (void )setBridge : (RCTBridge *)bridge {
20- _bridge = bridge;
23+ if (cxxBridge == nil ) {
24+ return @false ;
25+ }
2126
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+ }
2631
27- auto jsiRuntime = (jsi::Runtime*)cxxBridge. runtime ;
32+ xxhash::install (jsiRuntime) ;
2833
29- xxhash::install (jsiRuntime) ;
34+ return @ true ;
3035}
3136
3237
33-
3438@end
You can’t perform that action at this time.
0 commit comments