Module

Halogen.Store.Select

Package
purescript-halogen-store
Repository
thomashoneyman/purescript-halogen-store

#Selector Source

newtype Selector store a

A Selector represents a selection a from the store store. It is commonly used with the connect and subscribe functions when connecting a component to the store.

A selector requires both a selection function from store -> a and an equality function for a. The equality function is used to make sure connected components are only notified when the selected state a has changed.

Constructors

#select Source

select :: forall store a. (a -> a -> Boolean) -> (store -> a) -> Selector store a

Create a Selector from an equality function and a function to select a sub-part of the store. The equality function will be used to determine if the selected state has changed.

#selectEq Source

selectEq :: forall store a. Eq a => (store -> a) -> Selector store a

Create a Selector from a function to select a sub-part of the store. The selector will use the Eq class to determine if the selected state has changed.

#selectAll Source

selectAll :: forall store. Selector store store

Create a Selector for the entire store.

#selectEmitter Source

selectEmitter :: forall store a. Selector store a -> Emitter store -> Emitter a

Apply a Selector to an Emitter so that the emitter only fires when the selected value changes, as determined by the selector's equality function.