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

Dependancy Injection error when multiple call injectDeps() #2

Open
terry-fei opened this issue Jan 16, 2016 · 4 comments
Open

Dependancy Injection error when multiple call injectDeps() #2

terry-fei opened this issue Jan 16, 2016 · 4 comments

Comments

@terry-fei
Copy link

when i make multiple layout like this

const MainLayoutCtx = injectDeps(context, actions)(MainLayout);
const OrgChartLayoutCtx = injectDeps(context, actions)(OrgChartLayout);

the method within actions will have tow context parameters like this

actions: {
  posts: {
    create(context, context, title, comment) {
      // the second parameter also context !
    }
  }
}

if i call injectDeps three times, it will be three context injected

actions: {
  posts: {
    create(context, context, context, title, comment) {
      // the second and third parameter also context !
    }
  }
}
@arunoda
Copy link
Contributor

arunoda commented Jan 16, 2016

Good one. I'll work on this.

arunoda added a commit that referenced this issue Jan 17, 2016
@arunoda
Copy link
Contributor

arunoda commented Jan 17, 2016

Check now. I updated a new version with a fix.

@terry-fei
Copy link
Author

Awesome!

@TimFletcher
Copy link

Brilliant! I had exactly this issue, came here, saw you'd reported it and that genius @arunoda's fixed it. Thanks guys!

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

3 participants