Module
Toestand
- Package
- purescript-toestand
- Repository
- garganscript/purescript-toestand
A simple way of managing a tree of state in react while retaining full control over rerendering.
Re-exports from Toestand.Boxes
#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
#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.
Re-exports from Toestand.Changes
#ShouldReload Source
type ShouldReload c = Change c -> Effect Boolean
An effect function which determines whether notifications should be sent.
Re-exports from Toestand.Classes
Re-exports from Toestand.Records
#useFocusedFields' Source
useFocusedFields' :: forall l out base box c. RowToList c l => ReadWrite box (Record c) => UseFocusedFields l out base box => box -> Hooks (Builder (Record base) (Record out))
Builder-returning variant of useFocusedFields
#useFocusedFields Source
useFocusedFields :: forall l out base box c. RowToList c l => ReadWrite box (Record c) => UseFocusedFields l out base box => box -> Record base -> Hooks (Record out)
Given a Box (or other ReadWrite) which points at a record, create a new record where each field is another Box focused over the corresponding field in the original record.
Read the current value. Will never cause a refresh.