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
This commit is contained in:
parent
67f6b32409
commit
a86559ffb5
|
@ -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: ' +
|
||||
|
|
Loading…
Reference in New Issue