Module

Toestand.Boxes

Package
purescript-toestand
Repository
garganscript/purescript-toestand

#Box Source

data Box b

Instances

#useBox Source

useBox :: forall b. b -> Hooks (Box b)

A hook which allocates a Box, a flexible mutable wrapper for state utilising a react ref

#useFocused Source

useFocused :: forall box b c. ReadWrite box b => (b -> c) -> (c -> b -> b) -> box -> Hooks (Box c)

Create a new box by focusing in on the box with accessor functions.

#useLive Source

useLive :: forall box b. Read box b => ShouldReload b -> box -> Hooks b

Return the live value of the box. Reload the current component when it is updated if the provided effectful callback returns true