private ReactContext CreateReactContext(IInvocationHandler handler) { var eventEmitter = new RCTDeviceEventEmitter(); eventEmitter.InvocationHandler = handler; var reactInstance = new TestReactInstance(eventEmitter); var reactContext = new ReactContext(); reactContext.InitializeWithInstance(reactInstance); return(reactContext); }
private static NetworkingModule CreateNetworkingModule(IHttpClient httpClient, IInvocationHandler handler) { var context = new ReactContext(); var eventEmitter = new RCTDeviceEventEmitter(); eventEmitter.InvocationHandler = handler; var reactInstance = new TestReactInstance(eventEmitter); context.InitializeWithInstance(reactInstance); return(new NetworkingModule(httpClient, context)); }
private static ReactContext CreateReactContext(IInvocationHandler handler) { var context = new ReactContext(); var jsTimers = new JSTimersExecution { InvocationHandler = handler, }; var reactInstance = new TestReactInstance(jsTimers); context.InitializeWithInstance(reactInstance); return(context); }
private static ReactContext CreateReactContext(IInvocationHandler handler) { var context = new ReactContext(); var ids = new List <int>(); var appStateModule = new AppStateModule(context); appStateModule.Initialize(); var eventEmitter = new RCTDeviceEventEmitter { InvocationHandler = handler, }; var reactInstance = new TestReactInstance(appStateModule, eventEmitter); context.InitializeWithInstance(reactInstance); return(context); }