aweary / react-copy-write

✍️ Immutable state with a mutable API
MIT License
1.79k stars 54 forks source link

Remove selector prop and add selectors #32

Closed aweary closed 6 years ago

aweary commented 6 years ago

Having a polymorphic API for selector made it really hard to type. Especially since a selector could itself return an array. This change removes the selector prop and adds selectors, which requires that an array of selectors be provided in all cases.

If no selectors are provided the consumer will be rendered with a tuple of type [State], meaning the consumer callback will always render with an array.