Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/src/Mock/mocks/AppRegistryService.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { ComponentProvider } from 'react-native';

export class AppRegistryService {
registerComponent(_appKey: string, _getComponentFunc: ComponentProvider) {}
}
7 changes: 4 additions & 3 deletions lib/src/Navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ export class NavigationRoot {

constructor(
private readonly nativeCommandsSender: NativeCommandsSender,
private readonly nativeEventsReceiver: NativeEventsReceiver
private readonly nativeEventsReceiver: NativeEventsReceiver,
private readonly appRegistryService: AppRegistryService
) {
this.componentWrapper = new ComponentWrapper();
this.store = new Store();
Expand All @@ -59,12 +60,12 @@ export class NavigationRoot {
this.nativeEventsReceiver,
this.store
);
const appRegistryService = new AppRegistryService();

this.componentRegistry = new ComponentRegistry(
this.store,
this.componentEventsObserver,
this.componentWrapper,
appRegistryService
this.appRegistryService
);
this.layoutTreeParser = new LayoutTreeParser(this.uniqueIdProvider);
const optionsProcessor = new OptionsProcessor(
Expand Down
13 changes: 9 additions & 4 deletions lib/src/NavigationDelegate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,24 @@ import { OptionsProcessor as OptionProcessor } from './interfaces/Processors';
import { NavigationRoot } from './Navigation';
import { NativeCommandsSender } from './adapters/NativeCommandsSender';
import { NativeEventsReceiver } from './adapters/NativeEventsReceiver';
import { AppRegistryService } from './adapters/AppRegistryService';

export class NavigationDelegate {
private concreteNavigation: NavigationRoot;
constructor() {
this.concreteNavigation = this.createConcreteNavigation(
new NativeCommandsSender(),
new NativeEventsReceiver()
new NativeEventsReceiver(),
new AppRegistryService()
);
}

private createConcreteNavigation(
nativeCommandsSender: NativeCommandsSender,
nativeEventsReceiver: NativeEventsReceiver
nativeEventsReceiver: NativeEventsReceiver,
appRegistryService: AppRegistryService
) {
return new NavigationRoot(nativeCommandsSender, nativeEventsReceiver);
return new NavigationRoot(nativeCommandsSender, nativeEventsReceiver, appRegistryService);
}

/**
Expand Down Expand Up @@ -226,9 +229,11 @@ export class NavigationDelegate {
public mockNativeComponents() {
const { NativeCommandsSender } = require('./Mock/mocks/NativeCommandsSender');
const { NativeEventsReceiver } = require('./Mock/mocks/NativeEventsReceiver');
const { AppRegistryService } = require('./Mock/mocks/AppRegistryService');
this.concreteNavigation = this.createConcreteNavigation(
new NativeCommandsSender(),
new NativeEventsReceiver()
new NativeEventsReceiver(),
new AppRegistryService()
);
}

Expand Down