From 0c46953ad0aa5a715206ff24ccfa13c58cbbb132 Mon Sep 17 00:00:00 2001 From: Jean Lauliac Date: Fri, 10 Mar 2017 04:00:52 -0800 Subject: [PATCH] packager: node-haste: async load() Reviewed By: cpojer Differential Revision: D4673384 fbshipit-source-id: 816529f8947079b4003c8e91443e221184fd589d --- packager/src/node-haste/index.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/packager/src/node-haste/index.js b/packager/src/node-haste/index.js index e4b502ec5..55bf309ac 100644 --- a/packager/src/node-haste/index.js +++ b/packager/src/node-haste/index.js @@ -115,20 +115,19 @@ class DependencyGraph extends EventEmitter { }); } - static load(opts: Options): Promise { + static async load(opts: Options): Promise { const initializingPackagerLogEntry = log(createActionStartEntry('Initializing Packager')); opts.reporter.update({type: 'dep_graph_loading'}); const haste = DependencyGraph._createHaste(opts); - return haste.build().then(({hasteFS, moduleMap}) => { - log(createActionEndEntry(initializingPackagerLogEntry)); - opts.reporter.update({type: 'dep_graph_loaded'}); - return new DependencyGraph({ - opts, - haste, - initialHasteFS: hasteFS, - initialModuleMap: moduleMap, - }); + const {hasteFS, moduleMap} = await haste.build(); + log(createActionEndEntry(initializingPackagerLogEntry)); + opts.reporter.update({type: 'dep_graph_loaded'}); + return new DependencyGraph({ + opts, + haste, + initialHasteFS: hasteFS, + initialModuleMap: moduleMap, }); }