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

Export subclass of Ember.Service, run loops #18

Closed
wants to merge 3 commits into from
Closed

Export subclass of Ember.Service, run loops #18

wants to merge 3 commits into from

Conversation

romanmatiasko
Copy link

Ember 1.13.0-beta.2 expects service to be a subclass of Ember.Service.

Uncaught Error: Assertion Failed: Expected service:stripe to resolve to an Ember.Service but instead it was (unknown mixin).

See also emberjs/ember.js#11292.

There is only deprecation instead of assert in Ember Canary, but this is definitely more future-proof.

Also, simplified run loops as mentioned in #17.

@romanmatiasko romanmatiasko changed the title Export subclass of Ember.Service Export subclass of Ember.Service, run loops Jun 15, 2015
resolve(response);

Ember.run.end();
Ember.run(null, response.error ? reject : resolve, response);
Copy link
Collaborator

Choose a reason for hiding this comment

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

please don't use ternary operators, they make code less clear

@buritica
Copy link
Collaborator

buritica commented Jul 6, 2015

Thanks for sending this over, if you get rid of the ternary operators I'll merge this in.

@romanmatiasko
Copy link
Author

Thanks for feedback, they have been removed.

@buritica
Copy link
Collaborator

hey @romanmatiasko thanks for your contribution, since the run loop optimization breaks the addon, I've gone ahead and separated the service update into #18 and will be closing this in favor of it.

@buritica buritica closed this Jul 19, 2015
buritica added a commit that referenced this pull request Jul 19, 2015
[improve] export service as suggested by #18
buritica added a commit that referenced this pull request Jul 19, 2015
buritica added a commit that referenced this pull request Jul 19, 2015
[fix] ember run loop, as suggested in #17 and #18
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.

2 participants