From dcc4db53f9feade28736d6334c6f91fa955ad9eb Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 13 Jul 2017 17:51:14 +0100 Subject: [PATCH] Async functions now return `bluebird` promises, remove redundant Promise.resolve --- src/autocomplete/Autocompleter.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/autocomplete/Autocompleter.js b/src/autocomplete/Autocompleter.js index 8d78aa448a..e47c5dd59c 100644 --- a/src/autocomplete/Autocompleter.js +++ b/src/autocomplete/Autocompleter.js @@ -58,9 +58,10 @@ export async function getCompletions(query: string, selection: SelectionRange, f // single timeout to reject the Promise.all, reflect each one and once they've all // settled, filter for the fulfilled ones PROVIDERS.map((provider) => { - // Convert to bluebird promise so that we can do a timeout - const p = Promise.resolve(provider.getCompletions(query, selection, force)); - return p.timeout(PROVIDER_COMPLETION_TIMEOUT).reflect(); + return provider + .getCompletions(query, selection, force) + .timeout(PROVIDER_COMPLETION_TIMEOUT) + .reflect(); }), );