From a86559ffb54d876306aefab586ab75a68b7f1500 Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Tue, 14 Feb 2017 15:21:42 -0800 Subject: [PATCH] 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 --- Libraries/ReactNative/AppRegistry.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Libraries/ReactNative/AppRegistry.js b/Libraries/ReactNative/AppRegistry.js index 20baa1858..cca306fb5 100644 --- a/Libraries/ReactNative/AppRegistry.js +++ b/Libraries/ReactNative/AppRegistry.js @@ -43,6 +43,10 @@ type Runnable = { type Runnables = { [appKey: string]: Runnable, }; +type Registry = { + sections: Array, + 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: ' +