Resolve Promises externally

defer(){ const deferred = { promise: null, resolve: null, reject : null }; deferred.promise = new Promise( (resolve, reject) => { deferred.resolve = resolve; deferred.reject = reject; }); return } const treeBuild = defer(); treeBuild.promise.then(doSomething); this.treeBuild.resolve();

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.