[domain-task] addTask: return promise #451

Closed
opened 2025-08-09 17:16:20 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @stephtr on 9/2/2017

Wouldn't it be more useful if addTask would return the original promise?
One could then write const response = await addTask(fetch('/api/test')); instead of

const task = fetch('/api/test');
addTask(task);
const response = await task;

Edit: @DanHarman also mentioned it.

*Originally created by @stephtr on 9/2/2017* Wouldn't it be more useful if `addTask` would return the original promise? One could then write `const response = await addTask(fetch('/api/test'));` instead of ``` const task = fetch('/api/test'); addTask(task); const response = await task; ``` Edit: [@DanHarman](https://github.com/aspnet/JavaScriptServices/issues/902#issuecomment-299418722) also mentioned it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#451
No description provided.