Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

[domain-task] addTask: return promise #1249

Closed
stephtr opened this issue Sep 2, 2017 · 1 comment
Closed

[domain-task] addTask: return promise #1249

stephtr opened this issue Sep 2, 2017 · 1 comment

Comments

@stephtr
Copy link
Contributor

stephtr commented Sep 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.

@stephtr stephtr changed the title [domain-task] addTask: return task [domain-task] addTask: return promise Sep 2, 2017
@SteveSandersonMS
Copy link
Member

Thanks - I'll close this in favour of #1252.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants