Module

React.Halo.Component

Package
purescript-react-halo
Repository
robertdp/purescript-react-halo

#HookSpec Source

type HookSpec props ctx state action m = { context :: ctx, eval :: Lifecycle props ctx action -> HaloM props ctx state action m Unit, initialState :: state, props :: props }

#UseHalo Source

newtype UseHalo props ctx state action hooks

Constructors

Instances

#useHalo Source

useHalo :: forall props ctx state action. HookSpec props ctx state action Aff -> Hook (UseHalo props ctx state action) (state /\ (action -> Effect Unit))

Run renderless Halo in the current component. This allows Halo to be used with other hooks and other ways of building components.

#ComponentSpec Source

type ComponentSpec hooks props ctx state action m = { context :: props -> Render Unit hooks ctx, eval :: Lifecycle props ctx action -> HaloM props ctx state action m Unit, initialState :: props -> ctx -> state, render :: { context :: ctx, props :: props, send :: action -> Effect Unit, state :: state } -> JSX }

#component Source

component :: forall hooks props ctx state action. String -> ComponentSpec hooks props ctx state action Aff -> Component props

Build a component by providing a name and a Halo component spec.