redux-thunk-recursion-detect
Advanced tools
Comparing version 1.0.4 to 1.1.0
@@ -6,3 +6,6 @@ 'use strict'; | ||
function createRecursionDetectThunkMiddleware(extraArgument) { | ||
return ({ dispatch, getState }) => { | ||
return ({ | ||
dispatch, | ||
getState | ||
}) => { | ||
return next => action => { | ||
@@ -12,4 +15,6 @@ if (typeof action === 'function') { | ||
} | ||
return next(action); | ||
}; | ||
function wrappedDispatch(action) { | ||
@@ -19,2 +24,3 @@ if (typeof action === 'function') { | ||
} | ||
return dispatch(action); | ||
@@ -24,2 +30,3 @@ } | ||
} | ||
const thunk = createRecursionDetectThunkMiddleware(); | ||
@@ -29,3 +36,3 @@ thunk.withExtraArgument = createRecursionDetectThunkMiddleware; | ||
exports.default = thunk; | ||
exports.isNestedThunkSymbol = isNestedThunkSymbol; | ||
exports.default = thunk; |
function createRecursionDetectThunkMiddleware(extraArgument) { | ||
return ({ dispatch, getState }) => { | ||
return ({ | ||
dispatch, | ||
getState | ||
}) => { | ||
return next => action => { | ||
@@ -7,4 +10,6 @@ if (typeof action === 'function') { | ||
} | ||
return next(action); | ||
}; | ||
function wrappedDispatch(action) { | ||
@@ -14,2 +19,3 @@ if (typeof action === 'function') { | ||
} | ||
return dispatch(action); | ||
@@ -19,2 +25,3 @@ } | ||
} | ||
const thunk = createRecursionDetectThunkMiddleware(); | ||
@@ -21,0 +28,0 @@ thunk.withExtraArgument = createRecursionDetectThunkMiddleware; |
{ | ||
"name": "redux-thunk-recursion-detect", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "A drop-in replacement for `redux-thunk` that allows middleware to detect that a thunk has been dispatched from within another thunk", | ||
@@ -30,7 +30,8 @@ "main": "dist/reduxThunkRecursionDetect.cjs.js", | ||
"devDependencies": { | ||
"chai": "^4.1.2", | ||
"jest": "^23.1.0", | ||
"redux": "^4.0.0", | ||
"rollup": "^0.60.1" | ||
} | ||
"chai": "^4.2.0", | ||
"jest": "^24.8.0", | ||
"redux": "^4.0.1", | ||
"rollup": "^1.15.3" | ||
}, | ||
"gitHead": "64c9958f8959e453b5aeaa6bebd3e8261aea6ab5" | ||
} |
@@ -7,3 +7,3 @@ # redux-thunk-recursion-detect | ||
I wrote an explanation that helps understand one such case in [redux-thunk-error-handler's thunkErrorHandling.md](//github.com/itaylor/thunk-centric-redux/packages/redux-thunk-error-handler/thunkErrorHandling.md) | ||
I wrote an explanation that helps understand one such case in [redux-thunk-error-handler's thunkErrorHandling.md](//github.com/itaylor/thunk-centric-redux/blob/master/packages/redux-thunk-error-handler/thunkErrorHandling.md) | ||
@@ -43,3 +43,3 @@ | ||
Take a look at [redux-thunk-error-handler](//github.com/itaylor/thunk-centric-redux/packages/redux-thunk-error-handler/) to see a real application of this middleware. | ||
Take a look at [redux-thunk-error-handler](//github.com/itaylor/thunk-centric-redux/blob/master/packages/redux-thunk-error-handler/) to see a real application of this middleware. | ||
@@ -46,0 +46,0 @@ ## A part of the [thunk-centric-redux](//github.com/itaylor/thunk-centric-redux) set of tools |
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
6926
5
50