Module

React.Basic.Hooks.ResetToken

#UseResetToken

newtype UseResetToken hooks

Instances

#ResetToken

#useResetToken

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.

Modules