Module

Grain

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

Re-exports from Grain.Class.GProxy

#GProxy Source

data GProxy a

A type of global state proxy.

Constructors

#GlobalGrain Source

class GlobalGrain a 

Representation of a partial state of application state.

You can use this to define global state.

TypeRef is used as state key internally for uniqueness.

Re-exports from Grain.Class.KGProxy

#KGProxy Source

data KGProxy a

A type of keyed global state proxy.

Constructors

#KeyedGlobalGrain Source

class KeyedGlobalGrain a 

Representation of a partial state of application state.

You can use this to define global state with key for dynamic items.

TypeRef is used as state key internally for uniqueness.

Re-exports from Grain.Class.LProxy

#LProxy Source

data LProxy a

A type of component-local state proxy.

Constructors

#LocalGrain Source

class LocalGrain a 

Representation of a component-local state.

TypeRef is used as state key internally for uniqueness.

Re-exports from Grain.TypeRef

#fromConstructor Source

fromConstructor :: forall a. a -> TypeRef

Create a TypeRef.

Treat a constructor function as reference of type.

Re-exports from Grain.UI

#VNode Source

data VNode

The type of virtual node.

Instances

#Render Source

newtype Render a

The type of component renderer.

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

Instances

#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.

#usePortal Source

usePortal :: Effect Node -> Render (VNode -> VNode)

Get portal function.

#useFinder Source

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

Get a finder of a state.

#mount Source

mount :: VNode -> Node -> Effect Unit

Mount a VNode to a parent node.