Releases: reazen/relude-reason-react
Releases · reazen/relude-reason-react
v0.10.0
🚨 Breaking changes
- The
bs-abstract
peer-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
useRef
wrapper around thereducer
function 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.useReducer
makes no guarantees about how often thereducer
function 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 theupdate
constructors likeSideEffect
,UpdateWithSideEffect
,IO
, etc.
v0.8.1
v0.8.0
🚨 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 receivesstate
as the first argument andaction
as the second. This makes it more consistent withReact.useReducer
and allows for easier pattern matching on theaction
argument.
✨ New
- The
Effect
module 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
Reducer
module now includes function versions of theupdate
constructors, 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.IO
effect to happen when a component is mounted, and handle the result using some side-effecty function, likesend
ing an action, storing something inlocalStorage
, or whatever you need to do.
v0.6.0
✨ New
- Added
ReludeReact.Render.ifFalse
andifFalseLazy
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.re
for more info.
🚨 Breaking changes
- I changed the
Render
functions 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