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

Check if selector returns any values before trying to access them #105

Merged
merged 2 commits into from
Jan 20, 2020

Conversation

meikoudras
Copy link
Contributor

When connecting to non kea selectors and those reducers are also created lazily (e.g redux-form) the kea connect selector tries to directly access properties and crashes. Should check first if the reducer returns anything before trying to access properties of the result

@mariusandra
Copy link
Member

Hi, cool find and thanks for the fix!

Could you memoize the value of otherLogic(state, props) though? It might be an expensive operation and no need to call it twice... :)

@meikoudras
Copy link
Contributor Author

Done!

@mariusandra mariusandra merged commit c317a98 into keajs:master Jan 20, 2020
@mariusandra
Copy link
Member

🎉 v1.0.1 is out!

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