Module

React.Basic.Hooks.Aff

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

#UseAff Source

newtype UseAff key a hooks

Constructors

Instances

#Result Source

type Result a = Maybe (Either Error a)

#useAff Source

useAff :: forall a key. Eq key => key -> Aff a -> Hook (UseAff key a) (Result a)

useAff is used for asynchronous effects or Aff. The asynchronous effect is re-run whenever the key changes. If another Aff runs when the key changes before the previous async resolves, it will cancel the previous in flight async effect.