react-native-nitro-modules
Version:
Insanely fast native C++, Swift or Kotlin modules with a statically compiled binding layer to JSI.
34 lines (30 loc) • 822 B
JavaScript
;
import { NitroModules } from '../NitroModules';
export function installWorkletsSupport() {
try {
const {
registerCustomSerializable
} = require('react-native-worklets');
const boxedNitroProxy = NitroModules.box(NitroModules);
registerCustomSerializable({
name: 'nitro.HybridObject',
determine(value) {
'worklet';
const nitroProxy = boxedNitroProxy.unbox();
return nitroProxy.isHybridObject(value);
},
pack(value) {
'worklet';
const nitroProxy = boxedNitroProxy.unbox();
return nitroProxy.box(value);
},
unpack(value) {
'worklet';
return value.unbox();
}
});
} catch {
// react-native-worklets not installed.
}
}
//# sourceMappingURL=installWorkletsSupport.js.map