Skip to content

v0.8.0

Choose a tag to compare

@mlms13 mlms13 released this 22 Oct 17:12
· 40 commits to master since this release

🚨 Breaking changes

  • Argument order of useReducer has changed. Now the reducer function comes first and the initial state comes second, and the provided reducer function receives state as the first argument and action as the second. This makes it more consistent with React.useReducer and allows for easier pattern matching on the action argument.

✨ New

  • The Effect module now includes hooks like useEffect1WithEq, which allow you to provide an equality function for the values you wish to monitor for changes (where normal React JS uses a simple === check). This allows you to further limit how often an effect will run by providing a more change-tolerant equality function than ===.
  • The Reducer module now includes function versions of the update constructors, to make it easy to pipe, e.g. Api.fetchData() |> IO.bimap(...) |> Reducer.updateWithIO(Loading)