Module

JollyPong

Package
purescript-jolly-pong
Repository
justinwoo/purescript-jolly-pong

#Store Source

type Store e (state :: Type) (action :: Type) = { dispatch :: EffFn1 e action Unit, getState :: Eff e state, subscribe :: EffFn1 e (Listener e) (Dispose e) }

A Redux Store.

#Dispose Source

newtype Dispose e

A dispose function to unsubscribe from a store.

Constructors

#Reducer Source

newtype Reducer state action

A reducer. Note that the initial state in Redux is actually an undefined value.

Constructors

Instances

#Listener Source

newtype Listener e

A listener for Redux store subscriptions.

Constructors

#Middleware Source

newtype Middleware e state action

Middleware for Redux.

Constructors

#ActionVariant Source

newtype ActionVariant (actionRow :: Row Type)

an action variant that is meant to be converted to whatever the user needs. while this form is runtime compatible, users should use libraries like purescript-variant and decode this variant into Variant as needed.

Constructors

Instances

#createStore Source

createStore :: forall e action trash initialState state. Union initialState trash state => Reducer (Record state) action -> Record initialState -> Enhancer -> Eff e (Store e (Record state) action)

Create a store using the reducer, a subrow of the state, and enhancers.

#applyMiddleware Source

applyMiddleware :: forall e state action. Array (Middleware e state action) -> Eff e Enhancer

Apply middleware.

#combineReducers Source

combineReducers :: forall rl actionRow stateRow reducersRow. RowToList reducersRow rl => CombineReducers rl reducersRow stateRow actionRow => Record reducersRow -> Reducer (Record stateRow) (ActionVariant actionRow)

combine reducers from a record of reducers produces a correctly typed state row users are expected to use the action variant as needed

#CombineReducers Source

class CombineReducers (rl :: RowList) (row :: Row Type) (state :: Row Type) (action :: Row Type) | rl -> row state action

class to take the rowlist of reducers record passed in and prepare the state record row and a row of actions to be handled

Instances

#Enhancer Source

data Enhancer :: Type

#_createStore Source

_createStore :: forall initialState action state e. EffFn3 e (Reducer state action) initialState Enhancer (Store e state action)

#_combineReducers Source

_combineReducers :: forall action state reducers. reducers -> Reducer state action

#_applyMiddleware Source

_applyMiddleware :: forall middleware e. EffFn1 e (Array middleware) Enhancer
Modules
JollyPong