Module

Grain.Render

Package
purescript-grain
Repository
purescript-grain/purescript-grain

#Render Source

newtype Render a

The type of component renderer.

In this monad, you can declare that you use some states and updaters.

Instances

#Query Source

type Query = { selectValue :: forall a p. Grain p a => p a -> Effect a, updateValue :: forall a p. Grain p a => p a -> (a -> a) -> Effect Unit }

#runRender Source

runRender :: forall a. Render a -> Query -> Effect a

#useValue Source

useValue :: forall a p. Grain p a => p a -> Render a

Listen a state, then return it.

If the state is changed, the component will be rerendered.

#useUpdater Source

useUpdater :: forall a p. Grain p a => p a -> Render ((a -> a) -> Effect Unit)

Get an updater of a state.