Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Promise returns for all Mithril APIs requiring user-defined async resolutions #1486

Closed
barneycarroll opened this issue Dec 18, 2016 · 4 comments

Comments

@barneycarroll
Copy link
Member

In an effort to make Mithril API signatures more consistent and defer to standard contracts where possible, I propose we ensure all APIs that allow for authors to provide async resolution conditions rely on returning Promises.

This is already the case for request resolution and onmatch, and AFAICT the only outstanding API is onbeforeremove, which can then become more consistent with onbeforeupdate, whereby the signature will fall inline with the other lifecycle methods and have special concerns dictated by return value.

@lhorie
Copy link
Member

lhorie commented Dec 18, 2016

I'm +1 on this

@dead-claudia
Copy link
Member

dead-claudia commented Dec 18, 2016

The callbacks have admittedly felt a tad clunky, especially with onbeforeremove.

@tivac
Copy link
Contributor

tivac commented Dec 19, 2016

I think callbacks are nice and simple for a use-case like this, but I'm not opposed to a promise. I just wish it was easier to create/resolve them 😒

@lhorie
Copy link
Member

lhorie commented Dec 31, 2016

onbeforeremove now expects a promise

@lhorie lhorie closed this as completed Dec 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants