purescript-react / purescript-react-basic-hooks

An implementation of React hooks on top of purescript-react-basic
https://pursuit.purescript.org/packages/purescript-react-basic-hooks/
Apache License 2.0
198 stars 31 forks source link

Add useSteppingAff hook #72

Closed jship closed 1 year ago

jship commented 1 year ago

This PR adds a useSteppingAff variant of the useAff hook that preserves the previous async effect's result up until the next async effect's run completes. We use this variant at Lumi in cases where we'd like to avoid showing a page load indicator when refetching data from the backend, as the stepping behavior allows us to show the previous value right up until we've finished the API calls.