Module

Toestand.Changes

Package
purescript-toestand
Repository
garganscript/purescript-toestand

#Listener Source

type Listener c = Change c -> Effect Unit

An Effect function which is provided the new and old values.

#ShouldReload Source

type ShouldReload c = Change c -> Effect Boolean

An effect function which determines whether notifications should be sent.

#Change Source

type Change c = { new :: c, old :: c }

A summary of a change in value

#change Source

change :: forall a. a -> a -> Change a

Create a change positionally. new first.

#changed Source

changed :: forall a b. (a -> a -> b) -> Change a -> b

Adapt a positional function to a change function. new first.

#mapChange Source

mapChange :: forall c d. (c -> d) -> Change c -> Change d

Transform a Change by applying a function to both old and new values.

#unchanged Source

unchanged :: forall a b. (Change a -> b) -> a -> a -> b

Adapt a change function to a positional function. new first.

#unequal Source

unequal :: forall v. Eq v => Change v -> Effect Boolean

An equality based refresh predicate