robinweser / alveron

Tiny (0.8kb) Elm-inspired state management for React
https://alveron.js.org
MIT License
73 stars 2 forks source link

Provide Consumer API as an object #4

Closed robinweser closed 6 years ago

robinweser commented 6 years ago

Instead of passing everything as separate parameters, we should rather use an object to allow future additions not to extend the params even more.

// old
<Consumer>{(state, actions, effects, more, evenMore) => ...}</Consumer>
// old
<Consumer>{({ state, actions, effects, more, evenMore }) => ...}</Consumer>

It also helps to only pick the keys that are actually required without leaving blank params.