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 k a

A type of keyed global state proxy.

Constructors

#GrainKey Source

class GrainKey a 

Representation of key type for keyed global state.

This class's instances can be key for keyed global state.

Instances

#KeyedGlobalGrain Source

class (GrainKey k) <= KeyedGlobalGrain k a | a -> k

Representation of a partial state of application state.

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

The first parameter is a type of key for each item, and the second parameter is a type of item.

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.

#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 :: Render (forall a p. Grain p a => p a -> (a -> a) -> Effect Unit)

Get the updater for any state.

#usePortal Source

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

Get portal function.

#useFinder Source

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

Get the finder for any state.

#mount Source

mount :: VNode -> Node -> Effect Unit

Mount a VNode to a parent node.