redux-action-tools
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -143,3 +143,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
function createAsyncAction(type, payloadCreator, metaCreator) { | ||
function createAsyncAction(type, payloadCreator, metaCreator, takeLatest) { | ||
var startAction = createAction(type, identity, function (_, meta) { | ||
@@ -155,6 +155,7 @@ return meta; | ||
var currentReq = 0; | ||
return function (syncPayload) { | ||
return function (dispatch, getState) { | ||
dispatch(startAction(syncPayload, getAsyncMeta(metaCreator, syncPayload, ASYNC_PHASES.START))); | ||
var promise = payloadCreator(syncPayload, dispatch, getState); | ||
@@ -215,7 +216,5 @@ | ||
}, | ||
build: function build() { | ||
build: function build(initValue) { | ||
var _this2 = this; | ||
var initValue = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0]; | ||
return function () { | ||
@@ -222,0 +221,0 @@ var state = arguments.length <= 0 || arguments[0] === undefined ? initValue : arguments[0]; |
{ | ||
"name": "redux-action-tools", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "redux action tools with full async support inspired by redux-action", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -64,3 +64,3 @@ import camelCase from 'camelcase'; | ||
function createAsyncAction(type, payloadCreator, metaCreator) { | ||
function createAsyncAction(type, payloadCreator, metaCreator, takeLatest) { | ||
const startAction = createAction(type, identity, (_, meta) => meta); | ||
@@ -70,2 +70,4 @@ const completeAction = createAction(`${type}_${ASYNC_PHASES.COMPLETED}`, identity, (_, meta) => meta); | ||
let currentReq = 0; | ||
return syncPayload => { | ||
@@ -76,3 +78,2 @@ return (dispatch, getState) => { | ||
); | ||
const promise = payloadCreator(syncPayload, dispatch, getState); | ||
@@ -138,3 +139,3 @@ | ||
}, | ||
build(initValue = null) { | ||
build(initValue) { | ||
return (state = initValue, action) => { | ||
@@ -141,0 +142,0 @@ const handler = action ? this.handlers[action.type] : undefined; |
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
387
19102