Module

Halogen.Store.Select

#Selector

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

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

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

selectAll :: forall store. Selector store store

Create a Selector for the entire store.

Modules