From 9549e4057abaf2a8f96bad1f255acd1c0b002cd2 Mon Sep 17 00:00:00 2001 From: Peter Velkov Date: Mon, 26 Jul 2021 14:40:58 +0300 Subject: [PATCH] refactor: Remove deferred.reject since it's not used --- lib/createDeferredTask.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/createDeferredTask.js b/lib/createDeferredTask.js index 0783a085..b5b2e308 100644 --- a/lib/createDeferredTask.js +++ b/lib/createDeferredTask.js @@ -1,16 +1,15 @@ /** * Create a deferred task that can be resolved when we call `resolve()` - * The returned promise will complete only when we call `resolve` or `reject` + * The returned promise will complete when we call `resolve` * Useful when we want to wait for a tasks that is resolved from an external action * * @template T - * @returns {{ resolve: function(*), reject: function(Error), promise: Promise }} + * @returns {{ resolve: function(*), promise: Promise }} */ export default function createDeferredTask() { const deferred = {}; - deferred.promise = new Promise((res, rej) => { + deferred.promise = new Promise((res) => { deferred.resolve = res; - deferred.reject = rej; }); return deferred;