reshow-flux-base
Advanced tools
Comparing version 0.18.1 to 0.18.2
@@ -121,3 +121,3 @@ "use strict"; | ||
* @param {StateType} ReducerState | ||
* @param {RefinedAction<ActionType>} ReducerAction | ||
* @param {ActionType} ReducerAction | ||
* @returns {StateType} | ||
@@ -145,3 +145,3 @@ */ | ||
* | ||
* @param {ReducerType<StateType, RefinedAction<ActionType>>} reducer | ||
* @param {ReducerType<StateType, ActionType>} reducer | ||
* @param {InitStateType<StateType>} [initState] | ||
@@ -160,4 +160,4 @@ * @returns {[StoreObject<StateType, ActionType>, DispatchFunction<StateType, ActionType>]} | ||
var startingState = state.current; | ||
var thisAction = refineAction(action, actionParams, startingState); | ||
var endingState = reducer(startingState, thisAction); | ||
var refinedAction = refineAction(action, actionParams, startingState); | ||
var endingState = reducer(startingState, /**@type any*/refinedAction); | ||
if (endingState === _reshowConstant.T_UNDEFINED) { | ||
@@ -169,3 +169,3 @@ console.trace(); | ||
state.current = endingState; | ||
mitt.emit(endingState, thisAction, startingState); | ||
mitt.emit(endingState, refinedAction, startingState); | ||
} | ||
@@ -172,0 +172,0 @@ return endingState; |
@@ -21,5 +21,5 @@ "use strict"; | ||
(0, _classCallCheck2["default"])(this, ActionObject); | ||
/** @type {string|SAFE_UNDEFINED=} */ | ||
/** @type {string} */ | ||
(0, _defineProperty2["default"])(this, "type", void 0); | ||
/** @type {Payload=} */ | ||
/** @type {?Payload=} */ | ||
(0, _defineProperty2["default"])(this, "params", void 0); | ||
@@ -26,0 +26,0 @@ }); |
{ | ||
"version": "0.18.1", | ||
"version": "0.18.2", | ||
"name": "reshow-flux-base", | ||
@@ -4,0 +4,0 @@ "repository": { |
@@ -8,3 +8,3 @@ export function refineAction<StateType, ActionType>(action: DispatchAction<StateType, ActionType>, params?: Payload, prevState?: StateType): ActionObject | ActionType; | ||
export type DispatchAction<StateType, ActionType> = string | ActionType | DispatchCallback<StateType, ActionType>; | ||
export type ReducerType<StateType, ActionType> = (ReducerState: StateType, ReducerAction: RefinedAction<ActionType>) => StateType; | ||
export type ReducerType<StateType, ActionType> = (ReducerState: StateType, ReducerAction: ActionType) => StateType; | ||
export type InitStateType<StateType> = StateType | (() => StateType); | ||
@@ -19,3 +19,3 @@ export type DispatchFunction<StateType, ActionType> = (action: DispatchAction<StateType, ActionType>, actionParams?: Payload) => StateType; | ||
* @param {StateType} ReducerState | ||
* @param {RefinedAction<ActionType>} ReducerAction | ||
* @param {ActionType} ReducerAction | ||
* @returns {StateType} | ||
@@ -40,7 +40,7 @@ */ | ||
* | ||
* @param {ReducerType<StateType, RefinedAction<ActionType>>} reducer | ||
* @param {ReducerType<StateType, ActionType>} reducer | ||
* @param {InitStateType<StateType>} [initState] | ||
* @returns {[StoreObject<StateType, ActionType>, DispatchFunction<StateType, ActionType>]} | ||
*/ | ||
declare function createReducer<StateType, ActionType>(reducer: ReducerType<StateType, RefinedAction<ActionType>>, initState?: InitStateType<StateType>): [StoreObject<StateType, ActionType>, DispatchFunction<StateType, ActionType>]; | ||
declare function createReducer<StateType, ActionType>(reducer: ReducerType<StateType, ActionType>, initState?: InitStateType<StateType>): [StoreObject<StateType, ActionType>, DispatchFunction<StateType, ActionType>]; | ||
import { StoreObject } from "./type"; |
@@ -11,6 +11,6 @@ /** | ||
export class ActionObject { | ||
/** @type {string|SAFE_UNDEFINED=} */ | ||
type: (string | SAFE_UNDEFINED) | undefined; | ||
/** @type {Payload=} */ | ||
params: Payload | undefined; | ||
/** @type {string} */ | ||
type: string; | ||
/** @type {?Payload=} */ | ||
params: (Payload | null) | undefined; | ||
} | ||
@@ -17,0 +17,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38388
1200