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

create factory should invoke function with context if module is a method of an object #176

Open
ChrisEineke opened this issue Sep 21, 2015 · 0 comments

Comments

@ChrisEineke
Copy link

By allowing the resolved method to be called with a bound this, it would allow one to implement the Builder pattern without having to pass all dependencies as method parameters (because this is undefined). At first glance this could be accomplished by fixing instantiate.js's instantiate function to provide a this arg in the invocation of apply:

begotten = ctor.apply(undef, args);

I also tried to use the invoker factory, but there some spookiness going on with regards to promises...

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

1 participant