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

Component did connect hook #306

Merged
merged 6 commits into from
Jun 7, 2015
Merged

Component did connect hook #306

merged 6 commits into from
Jun 7, 2015

Conversation

ericwooley
Copy link
Contributor

I added an API for component did connect, I am not sure if this was where you wanted it in the source, not quite sure how to ensure it makes it into the decorator. Let me know if you want me to change it.

@goatslacker
Copy link
Owner

I was thinking it would be a static function similar to how getPropsFromStores is already

@ericwooley
Copy link
Contributor Author

If you make it a static, then it will fire every time any of the components are mounted, and you would not have no access to this.

Seemed weird to me that it would fire for every mount, but not have access to this. I can switch it if you want though, then it wouldn't require a ref, which is nice.

@@ -66,6 +66,9 @@ function connectToStores(Component) {
stores.forEach((store) => {
store.listen(this.onChange)
})
if (typeof Component.componentDidConnect === 'function') {
Copy link
Owner

Choose a reason for hiding this comment

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

we can assume its a function

and we should pass in props and context

goatslacker added a commit that referenced this pull request Jun 7, 2015
@goatslacker goatslacker merged commit 464bb26 into goatslacker:master Jun 7, 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.

2 participants