Module

React.Halo.Component

#HookSpec

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

newtype UseHalo props ctx state action hooks

Constructors

Instances

#useHalo

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

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

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.

Modules