Return a promise from task.start()
See original GitHub issueWhat do you think if task.start()
function would return a promise which could be fulfilled with task’s results or rejected in case of error?
In some scenarios, it’s more preferable rather than tracking task’s pending/result values,
i.e. const { pending, error, result } = task;
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Using promises - JavaScript - MDN Web Docs
Essentially, a promise is a returned object to which you attach callbacks, instead of passing callbacks into a function. Imagine a function, ...
Read more >Promise equivalent in C# - Stack Overflow
I just have an access to a handler that will be run on another thread. c# · promise · async-await · task ·...
Read more >Difference between a Promise and a Task
Once you have a Promise instance the action has already started. Task instance does not run until someone calls .fork().
Read more >promiseDAG
When task 1 and task 2 are finished, the function task3 is called to start the 3rd task, and it gets the return...
Read more >25. Promises for asynchronous programming
Promise reactions are callbacks that you register with the Promise method then() , to be notified of a fulfillment or a rejection. A...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Published: https://www.npmjs.com/package/react-hooks-async/v/3.5.0
@dai-shi Thank you for the quick reply and fast update! I very much appreciate your work.