Module

React.Basic.Hooks.ResetToken

Package
purescript-react-basic-hooks
Repository
spicydonuts/purescript-react-basic-hooks

#UseResetToken Source

newtype UseResetToken hooks

Instances

#ResetToken Source

data ResetToken :: Type

Instances

#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, an effect or API call which depends on the state of a search bar with filters. You may want a button in the UI either for UX reasons or to refresh possibly stale data. In this case you would include a ResetToken in your search effect/aff's dependencies and call run useResetToken's reset effect in the button's onClick.