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

Defer 'Store#emitChange' until promise resolve #159

Closed
wants to merge 1 commit into from

Conversation

mehcode
Copy link

@mehcode mehcode commented Apr 14, 2015

No description provided.

@mehcode mehcode force-pushed the feature-store-promise branch from 51fe5ef to 2378c07 Compare April 14, 2015 04:59
@goatslacker
Copy link
Owner

This is fairly clean. Some initial thoughts: this needs to check if Promise exists, this only works for one store?

if (result !== false && this[SET_STATE] === false) {
this.emitChange()
if (this[SET_STATE] === false) {
if (result instanceof Promise) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've included this change in #234

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome; thanks for taking this and making it much better. 👍

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is an old commit that doesn't seem that it'll get merged it. Just an FYI that object instanceof Promise fails on Chrome for native promises.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 we have an isPromise check.

@mehcode mehcode closed this May 5, 2015
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

Successfully merging this pull request may close these issues.

3 participants