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 predicate for the '.withProps' method #194

Open
ChrisLane opened this issue Apr 26, 2023 · 3 comments
Open

Add predicate for the '.withProps' method #194

ChrisLane opened this issue Apr 26, 2023 · 3 comments

Comments

@ChrisLane
Copy link

I would like a new version of withProps that is able to accept a function as an argument that determines whether a component should be returned.

Example use case:
We pass Immutable.js objects to component properties and want to match against their values.
Currently, I'm not aware of a clean way that we can do this but with the above proposal, we could hopefully do something like this:

const mySelector = ReactSelector("MyComponent").withProps(props => props.config.toJS().valueToCheck === "matching value")
@miherlosev
Copy link

Hi @ChrisLane,

Thank you for sharing this idea with us.

@miherlosev miherlosev changed the title withProps that accepts a function that returns a boolean for matching Add predicate for the '.withProps' method Apr 28, 2023
Copy link

This issue has been automatically marked as stale because it has not had any activity for a long period. It will be closed and archived if no further activity occurs. However, we may return to this issue in the future. If it still affects you or you have any additional information regarding it, please leave a comment and we will keep it open.

@ChrisLane
Copy link
Author

Bump

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

No branches or pull requests

3 participants