Memoize lazy module configs

Reviewed By: javache

Differential Revision: D3293010

fbshipit-source-id: feab7bb0a1f8990baea9c0aca8c9c3cccbcb04e8
This commit is contained in:
Alexander Blom 2016-05-16 03:55:58 -07:00 committed by Facebook Github Bot 3
parent ccef1b2941
commit 9a899bed65
1 changed files with 5 additions and 0 deletions

View File

@ -51,6 +51,11 @@ Object.keys(RemoteModules).forEach((moduleName) => {
module = config && BatchedBridge.processModuleConfig(config, module.moduleID);
RemoteModules[moduleName] = module;
}
Object.defineProperty(NativeModules, moduleName, {
configurable: true,
enumerable: true,
value: module,
});
return module;
},
});