From 9a899bed652415cfab28a99451e3f755cb0aec9a Mon Sep 17 00:00:00 2001 From: Alexander Blom Date: Mon, 16 May 2016 03:55:58 -0700 Subject: [PATCH] Memoize lazy module configs Reviewed By: javache Differential Revision: D3293010 fbshipit-source-id: feab7bb0a1f8990baea9c0aca8c9c3cccbcb04e8 --- .../BatchedBridge/BatchedBridgedModules/NativeModules.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Libraries/BatchedBridge/BatchedBridgedModules/NativeModules.js b/Libraries/BatchedBridge/BatchedBridgedModules/NativeModules.js index e374ddab9..dfbd9edd1 100644 --- a/Libraries/BatchedBridge/BatchedBridgedModules/NativeModules.js +++ b/Libraries/BatchedBridge/BatchedBridgedModules/NativeModules.js @@ -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; }, });