Module

Halogen.Store.Connect

#Connected

type Connected context input = { context :: context, input :: input }

The input type for connected components, containing the selected context from the store and the component's ordinary Halogen input.

#connect

connect :: forall action store context query input output m. MonadEffect m => MonadStore action store m => Selector store context -> Component query (Connected context input) output m -> Component query input output m

Connect a component to part of the store using a Selector. The selected state will be provided as part of the component's input. Any time the selected state changes the component will be notified with new input.

#subscribe

subscribe :: forall storeAction store context state action slots output m. MonadStore storeAction store m => Selector store context -> (context -> action) -> HalogenM state action slots output m Unit

Subscribe to changes in the selected state by providing an action to run any time the state updates. This can be used to connect components to the store with more manual control than connect provides.

Modules