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

Describe path using dot(.) not array #2456

Closed
sujameslin opened this issue Feb 1, 2018 · 1 comment
Closed

Describe path using dot(.) not array #2456

sujameslin opened this issue Feb 1, 2018 · 1 comment

Comments

@sujameslin
Copy link

E.g.
Instead of R.path(['navigation', 'state', 'params', 'tabBarVisible'], this.props)
R.path('navigation.state.params.tabBarVisible', this.props) is more convenient to use.

@davidchambers
Copy link
Member

This is problematic because . is a valid character in a property name. You could define such a function yourself if this potential conflict is not applicable to your program. For example:

//    myPath :: String -> Object -> Any
const myPath = R.useWith(R.path, [R.split('.')]);

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

2 participants