Module
React.Basic.Hooks.ResetToken
- Package
- purescript-react-basic-hooks
- Repository
- spicydonuts/purescript-react-basic-hooks
#UseResetToken Source
newtype UseResetToken hooks
Constructors
UseResetToken (UseState Int hooks)
Instances
Newtype (UseResetToken hooks) _
#useResetToken Source
useResetToken :: Hook UseResetToken (ResetToken /\ (Effect Unit))
Useful for resetting effects or component state. A ResetToken
can be
used alongside other hook dependencies to force a reevaluation of
whatever depends on those dependencies.
For example, consider an effect or API call which depends on the state
of a search bar. You may want a button in the UI to refresh stale data.
In this case you would include a ResetToken
in your search effect/aff's
dependencies and call useResetToken
's reset effect in the button's
onClick
handler.