redux-substore
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -31,12 +31,13 @@ 'use strict'; | ||
initialState = _ref.initialState, | ||
responseMap = _ref.responseMap; | ||
responseMap = _ref.responseMap, | ||
actionMeta = _ref.actionMeta; | ||
_classCallCheck(this, Substore); | ||
this.clearAction = function () { | ||
return { type: _this2.ACTION_TYPE.CLEAR }; | ||
}; | ||
this.requestAction = function (payload) { | ||
return { type: _this2.ACTION_TYPE.REQUEST, payload: payload }; | ||
return { | ||
type: _this2.ACTION_TYPE.REQUEST, | ||
meta: _this2.actionMeta.requestAction, | ||
payload: payload | ||
}; | ||
}; | ||
@@ -47,2 +48,3 @@ | ||
type: _this2.ACTION_TYPE.FAILURE, | ||
meta: _this2.actionMeta.failureAction, | ||
payload: error, | ||
@@ -56,2 +58,3 @@ error: true | ||
type: _this2.ACTION_TYPE.SUCCESS, | ||
meta: _this2.actionMeta.successAction, | ||
payload: payload | ||
@@ -61,2 +64,6 @@ }; | ||
this.clearAction = function () { | ||
return { type: _this2.ACTION_TYPE.CLEAR, meta: _this2.actionMeta.clearAction }; | ||
}; | ||
this.reducer = function () { | ||
@@ -111,2 +118,3 @@ var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this2.initialState; | ||
}; | ||
this.actionMeta = actionMeta || {}; | ||
@@ -128,6 +136,6 @@ try { | ||
return { | ||
REQUEST: this.prefix + '_REQUEST', | ||
CLEAR: this.prefix + '_CLEAR', | ||
FAILURE: this.prefix + '_REQUEST_FAILURE', | ||
SUCCESS: this.prefix + '_REQUEST_SUCCESS' | ||
REQUEST: this.prefix + 'REQUEST', | ||
CLEAR: this.prefix + 'CLEAR', | ||
FAILURE: this.prefix + 'REQUEST_FAILURE', | ||
SUCCESS: this.prefix + 'REQUEST_SUCCESS' | ||
}; | ||
@@ -134,0 +142,0 @@ } |
{ | ||
"name": "redux-substore", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"main": "dist/src/index.js", | ||
@@ -5,0 +5,0 @@ "devDependencies": { |
150250
426