Module

React.Redux.Types

Package
purescript-react-redux
Repository
ethul/purescript-react-redux

#REDUX Source

data REDUX :: Effect

Effect type for Redux.

#ReduxEffect Source

type ReduxEffect eff = (redux :: REDUX | eff)

Convenience type alias for the Redux effect.

#Reducer Source

type Reducer action state = Reducer action state state

Reducer that does not change the type of the state.

#BaseDispatch Source

type BaseDispatch eff action = Dispatch eff action action

Dispatching function that returns the action it was passed.

#Dispatch Source

type Dispatch eff action result = action -> Eff (ReduxEffect eff) result

Dispatching function that returns a result type given an action.

#ReduxAction Source

type ReduxAction r = { type :: String | r }

Redux actions must be a record with a type field.

#ReduxAction' Source

type ReduxAction' action = ReduxAction (action :: action)

Convenience type for converting an action in this module to a ReduxAction.

#ReduxReducer Source

type ReduxReducer state action = Fn2 state (ReduxAction' (Nullable action)) state

Reducing function that takes a state and ReduxAction and returns a state.

#ReduxBaseDispatch Source

type ReduxBaseDispatch eff action = EffFn1 (ReduxEffect eff) (ReduxAction' action) (ReduxAction' action)

The ReduxBaseDispatch is the dispatching function provided to the store without any middleware.

#ReduxDispatch Source

type ReduxDispatch eff action result = EffFn1 (ReduxEffect eff) (ReduxAction' action) result

Allows ReduxMiddleware to wrap the ReduxBaseDispatch function to return a different result to be passed to the next ReduxMiddleware.

#ReduxMiddlewareAPI Source

type ReduxMiddlewareAPI eff state action = { dispatch :: ReduxBaseDispatch eff action, getState :: Eff (ReduxEffect eff) state }

Simplified Store representation passed to each middleware.

#ReduxMiddleware Source

type ReduxMiddleware eff state action a b = ReduxMiddlewareAPI eff state action -> ReduxDispatch eff action a -> ReduxDispatch eff action b

Function that composes dispatch functions. Purposely restricted to dispatching action types here.

#ReduxStoreCreator Source

data ReduxStoreCreator :: Row Effect -> Type -> Type -> Type

Foreign Redux store creator function.

#ReduxStoreEnhancer Source

type ReduxStoreEnhancer eff state action = ReduxStoreCreator eff state action -> ReduxStoreCreator eff state action

Type alias for a foreign Redux store enhancer, taking a ReduxStoreCreator and returning a ReduxStoreCreator.

#ReduxStore Source

type ReduxStore eff state action = { dispatch :: ReduxBaseDispatch eff action, getState :: Eff (ReduxEffect eff) state, replaceReducer :: EffFn1 (ReduxEffect eff) (ReduxReducer state action) Unit, subscribe :: Eff (ReduxEffect eff) Unit -> Eff (ReduxEffect eff) Unit }

Type alias for a foreign ReduxStore