Permalink
Browse files

expose AppRegistry.getRegistry() for app specific handling

Summary: Add simple `getRegistry()` so that add can do some custom handling of the registered components, if appropriate.

Reviewed By: shergin

Differential Revision: D4550600

fbshipit-source-id: 367c66b9fddfe4cc81cbc32a7a6043215e0df666
  • Loading branch information...
fkgozali authored and facebook-github-bot committed Feb 14, 2017
1 parent 67f6b32 commit a86559ffb54d876306aefab586ab75a68b7f1500
Showing with 11 additions and 0 deletions.
  1. +11 −0 Libraries/ReactNative/AppRegistry.js
@@ -43,6 +43,10 @@ type Runnable = {
type Runnables = {
[appKey: string]: Runnable,
};
type Registry = {
sections: Array<string>,
runnables: Runnables,
};
const runnables: Runnables = {};
let runCount = 1;
@@ -128,6 +132,13 @@ const AppRegistry = {
return runnables[appKey];
},
getRegistry(): Registry {
return {
sections: AppRegistry.getSectionKeys(),
runnables: {...runnables},
};
},
runApplication(appKey: string, appParameters: any): void {
const msg =
'Running application "' + appKey + '" with appParams: ' +

0 comments on commit a86559f

Please sign in to comment.