Releases: reazen/relude-reason-react
Releases · reazen/relude-reason-react
v0.10.0
🚨 Breaking changes
- The
bs-abstractpeer-dependency is nowbs-bastet, and the required Relude version is 0.59+. See the Relude release notes and the Bastet migration guide for details.
v0.9.0
✨ New
- @mattmarcello - Added a custom hook for managing a repeatable IO-based action
ReludeReact.Effect.UseAsyncResult.fromIO
v0.8.2
🐛 Bug fixes
- This release reverts the change made in v0.8.1 to add the
useRefwrapper around thereducerfunction inReludeReact.Reducer.useReducer. The ref wrapper was added to try to prevent unmanaged side effects from running multiple times in the reducer function, but it also had the undesired side effect of causing prop updates to be invisible to the reducer function. We've also learned thatReact.useReducermakes no guarantees about how often thereducerfunction will be run, and it's expected that the function will run more than once. Because of this, one should avoid using any unmanaged side-effects in the reducer function, and should instead use controlled side effects via theupdateconstructors likeSideEffect,UpdateWithSideEffect,IO, etc.
v0.8.1
v0.8.0
🚨 Breaking changes
- Argument order of
useReducerhas changed. Now the reducer function comes first and the initial state comes second, and the provided reducer function receivesstateas the first argument andactionas the second. This makes it more consistent withReact.useReducerand allows for easier pattern matching on theactionargument.
✨ New
- The
Effectmodule now includes hooks likeuseEffect1WithEq, 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
Reducermodule now includes function versions of theupdateconstructors, to make it easy to pipe, e.g.Api.fetchData() |> IO.bimap(...) |> Reducer.updateWithIO(Loading)
v0.7.0
✨ New
- Added
ReludeReact.Effect.useIOOnMount,useIOOnMountWithResult,useIOOnMountWithOk, anduseIOOnMountWithError- these are utility functions that allow you to register someRelude.IOeffect to happen when a component is mounted, and handle the result using some side-effecty function, likesending an action, storing something inlocalStorage, or whatever you need to do.
v0.6.0
✨ New
- Added
ReludeReact.Render.ifFalseandifFalseLazy
v0.5.0
Update all dependencies to latest
v0.4.0
✨ New stuff
- Added a bunch of render helpers for conditionally rendering AsyncResult for a variety of possible scenarios. See
ReludeReact_Render.refor more info.
🚨 Breaking changes
- I changed the
Renderfunctions to accept the significant data last for consistency with other Relude conventions. As these are brand new, this is not likely to break anyone.
v0.3.0
✨ New stuff
- New render utility functions in
ReludeReact.Render