Files
Schnappix/node_modules/expo-modules-core/ios/JSI/EXJavaScriptSharedObjectBinding.mm
T

25 lines
678 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Copyright 2025-present 650 Industries. All rights reserved.
#import <ExpoModulesCore/EXJSIConversions.h>
#import <ExpoModulesCore/EXJavaScriptSharedObjectBinding.h>
/**
A wrapper around a SharedObject getter The getter is a Swift lambda that creates the JS object and registers the pair in registry.
Needed to make sure the registration happens on the correct thread when called from inside EXJSIConversions.
*/
@implementation EXJavaScriptSharedObjectBinding
- (nonnull instancetype)initWithGetter:(EXJavaScriptObjectBindingGetter)getter
{
self.getter = getter;
return self;
}
- (EXJavaScriptObject *)get
{
auto obj = self.getter();
return obj;
}
@end