Module

JollyPong

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

#Store Source

type Store (state :: Type) (action :: Type) = { dispatch :: EffectFn1 action Unit, getState :: Effect state, subscribe :: EffectFn1 Listener Dispose }

A Redux Store.

#Dispose Source

newtype Dispose

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

A listener for Redux store subscriptions.

Constructors

#Middleware Source

newtype Middleware 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 action state' initialState state. Union initialState state' state => Reducer (Record state) action -> Record initialState -> Enhancer -> Effect (Store (Record state) action)

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

#applyMiddleware Source

applyMiddleware :: forall state action. Array (Middleware state action) -> Effect 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. EffectFn3 (Reducer state action) initialState Enhancer (Store state action)

#_combineReducers Source

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

#_applyMiddleware Source

_applyMiddleware :: forall middleware. EffectFn1 (Array middleware) Enhancer
Modules
JollyPong