oo-redux-utils
Advanced tools
Comparing version 1.3.3 to 1.4.0
@@ -30,2 +30,10 @@ "use strict"; | ||
function _createStateReducer(initialState, actionBaseClass, stateNamespace, componentType) { | ||
return function () { | ||
var currentState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
return (action.receivingComponentType && action.receivingComponentType === componentType || !action.receivingComponentType && action.type instanceof actionBaseClass) && action.type.getStateNamespace() === stateNamespace ? action.type.performActionAndReturnNewState(currentState) : currentState; | ||
}; | ||
} | ||
var OOReduxUtils = | ||
@@ -55,8 +63,22 @@ /*#__PURE__*/ | ||
key: "createStateReducer", | ||
value: function createStateReducer(initialState, actionBaseClass, stateNamespace, componentType) { | ||
return function () { | ||
var currentState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; | ||
var action = arguments.length > 1 ? arguments[1] : undefined; | ||
return (action.receivingComponentType && action.receivingComponentType === componentType || !action.receivingComponentType && action.type instanceof actionBaseClass) && action.type.getStateNamespace() === stateNamespace ? action.type.performActionAndReturnNewState(currentState) : currentState; | ||
}; | ||
value: function createStateReducer(initialState, actionBaseClass) { | ||
return _createStateReducer(initialState, actionBaseClass); | ||
} // noinspection JSUnusedGlobalSymbols | ||
}, { | ||
key: "createNamespacedStateReducer", | ||
value: function createNamespacedStateReducer(initialState, actionBaseClass, stateNamespace) { | ||
return _createStateReducer(initialState, actionBaseClass, stateNamespace); | ||
} // noinspection JSUnusedGlobalSymbols | ||
}, { | ||
key: "createStateReducerWithComponentType", | ||
value: function createStateReducerWithComponentType(initialState, actionBaseClass, componentType) { | ||
return _createStateReducer(initialState, actionBaseClass, undefined, componentType); | ||
} // noinspection JSUnusedGlobalSymbols | ||
}, { | ||
key: "createNamespacedStateReducerWithComponentType", | ||
value: function createNamespacedStateReducerWithComponentType(initialState, actionBaseClass, stateNamespace, componentType) { | ||
return _createStateReducer(initialState, actionBaseClass, stateNamespace, componentType); | ||
} | ||
@@ -63,0 +85,0 @@ }]); |
{ | ||
"name": "oo-redux-utils", | ||
"version": "1.3.3", | ||
"version": "1.4.0", | ||
"description": "Utility functions for Object-oriented Redux", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -0,0 +0,0 @@ # Object-oriented Redux Utils |
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
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
31048
177