Module
Radox.Internal.Types
- Package
- purescript-radox
- Repository
- danieljharvey/purescript-radox
#RadoxEffects Source
type RadoxEffects combinedActionType stateType = { dispatch :: combinedActionType -> Effect Unit, getState :: Effect stateType, state :: stateType }
#ReducerReturn Source
data ReducerReturn stateType
Type of return value from reducer
Constructors
NoOp
UpdateState stateType
UpdateStateAndRunEffect stateType (Aff Unit)
RunEffect (Aff Unit)
#EffectfulReducer Source
type EffectfulReducer actionType stateType combinedActionType = RadoxEffects combinedActionType stateType -> actionType -> stateType -> ReducerReturn stateType
Type for any user-created Reducer function that takes an Action for a specific reducer, the entire state, and returns a new copy of the state
#Reducer Source
type Reducer actionType stateType = actionType -> stateType -> stateType
Type for a reducer that does need to trigger any side effects
#CombinedReducer Source
type CombinedReducer combinedActionType stateType = RadoxEffects combinedActionType stateType -> stateType -> combinedActionType -> ReducerReturn stateType
Type for the user-created Combined Reducer function, that takes a Variant of any action, and pipes it to the correct Reducer function, then returns the new state
#Dispatcher Source
type Dispatcher combinedActionType = combinedActionType -> Effect Unit
A Dispatcher is the function that allows different parts of our app to send actions to the reducers and make Things Happen.
#RadoxStore Source
type RadoxStore combinedActionType stateType = { dispatch :: Dispatcher combinedActionType, getState :: Effect stateType, state :: stateType }
Type of store shared around so that the state can be accessed without needing Effect