Skip to content

Releases: reazen/relude-reason-react

v0.10.0

01 Apr 04:01
Compare
Choose a tag to compare

🚨 Breaking changes

v0.9.0

30 Mar 21:16
Compare
Choose a tag to compare

✨ New

  • @mattmarcello - Added a custom hook for managing a repeatable IO-based action
    • ReludeReact.Effect.UseAsyncResult.fromIO

v0.8.2

06 Feb 23:33
Compare
Choose a tag to compare

🐛 Bug fixes

  • This release reverts the change made in v0.8.1 to add the useRef wrapper around the reducer function in ReludeReact.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 that React.useReducer makes no guarantees about how often the reducer 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 the update constructors like SideEffect, UpdateWithSideEffect, IO, etc.

v0.8.1

30 Dec 01:58
Compare
Choose a tag to compare

🪲 Bug fixes

  • @jihchi - fix/workaround for #21 - reducer function being called more times than expected

v0.8.0

22 Oct 17:12
Compare
Choose a tag to compare

🚨 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)

v0.7.0

10 Sep 23:13
Compare
Choose a tag to compare

✨ New

  • Added ReludeReact.Effect.useIOOnMount, useIOOnMountWithResult, useIOOnMountWithOk, and useIOOnMountWithError - these are utility functions that allow you to register some Relude.IO effect to happen when a component is mounted, and handle the result using some side-effecty function, like sending an action, storing something in localStorage, or whatever you need to do.

v0.6.0

07 Sep 01:00
Compare
Choose a tag to compare

✨ New

  • Added ReludeReact.Render.ifFalse and ifFalseLazy

v0.5.0

22 Aug 14:45
Compare
Choose a tag to compare

Update all dependencies to latest

v0.4.0

11 Jul 15:30
Compare
Choose a tag to compare

✨ 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

11 Jul 05:38
Compare
Choose a tag to compare

✨ New stuff

  • New render utility functions in ReludeReact.Render