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

Add support for factoryFor #191

Closed
wants to merge 1 commit into from

Conversation

chadhietala
Copy link
Contributor

Prep work for emberjs/ember.js#14360

@Turbo87
Copy link
Member

Turbo87 commented Dec 18, 2016

@chadhietala I suppose we can't test this properly until the other PR is merged, correct?

Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

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

I'd like to export Ember._FactoryForProxyMixin upstream to simplify this logic a bit. What do you think?

I was thinking something like this might work:

const Owner = (function() {
  const OWNER_MIXINS = [
    Ember._RegistryProxyMixin,
    Ember._ContainerProxyMixin,
    Ember._FactoryForProxyMixin
  ].filter(Boolean)
 
  return Ember.Object.extend.apply(Ember.Object, OWNER_MIXINS);
})();

return Ember.Object.extend(Ember._RegistryProxyMixin, Ember._ContainerProxyMixin);
} else if (FACTORY_FOR && LOOKUP_FACTORY) {
Copy link
Member

Choose a reason for hiding this comment

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

Can this case actually happen?

@rwjblue
Copy link
Member

rwjblue commented Dec 18, 2016

Given my suggestion in emberjs/ember.js#14360 (review), no changes would be needed here in ember-test-helpers.

@chadhietala
Copy link
Contributor Author

Just going to put this stuff on the ContainerProxy mixin

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

Successfully merging this pull request may close these issues.

3 participants