react-native-navigation
Version:
React Native Navigation - truly native navigation for iOS and Android
25 lines (24 loc) • 1.2 kB
JavaScript
"use strict";
export class ComponentRegistry {
constructor(store, componentEventsObserver, componentWrapper, appRegistryService) {
this.store = store;
this.componentEventsObserver = componentEventsObserver;
this.componentWrapper = componentWrapper;
this.appRegistryService = appRegistryService;
}
registerComponent(componentName, componentProvider, concreteComponentProvider, ReduxProvider, reduxStore) {
const NavigationComponent = () => {
if (this.store.hasRegisteredWrappedComponent(componentName)) {
return this.store.getWrappedComponent(componentName);
} else {
const wrappedComponent = this.componentWrapper.wrap(componentName.toString(), componentProvider, this.store, this.componentEventsObserver, concreteComponentProvider, ReduxProvider, reduxStore);
this.store.setWrappedComponent(componentName, wrappedComponent);
return wrappedComponent;
}
};
this.store.setComponentClassForName(componentName.toString(), NavigationComponent);
this.appRegistryService.registerComponent(componentName.toString(), NavigationComponent);
return NavigationComponent;
}
}
//# sourceMappingURL=ComponentRegistry.js.map