@sigfox/redux-api-middleware
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [1.2.0](https://github.com/sigfox/javascript/compare/@sigfox/redux-api-middleware@1.1.0...@sigfox/redux-api-middleware@1.2.0) (2020-01-06) | ||
### Features | ||
* **redux-api-middleware:** dispatch actions with parentType prop ([d8b38d5](https://github.com/sigfox/javascript/commit/d8b38d5)) | ||
# [1.1.0](https://github.com/sigfox/javascript/compare/@sigfox/redux-api-middleware@1.0.1...@sigfox/redux-api-middleware@1.1.0) (2019-10-25) | ||
@@ -8,0 +19,0 @@ |
@@ -113,3 +113,5 @@ 'use strict'; | ||
function apiClientMiddleware(client) { | ||
var API_FAILURE = '@@redux-api-middleware/API_FAILURE'; | ||
var API_SUCCESS = '@@redux-api-middleware/API_SUCCESS'; | ||
function reduxApiMiddleware(client) { | ||
return function (_ref) { | ||
@@ -140,2 +142,3 @@ var dispatch = _ref.dispatch, | ||
type: SUCCESS, | ||
parentType: API_SUCCESS, | ||
payload: response.data, | ||
@@ -149,2 +152,3 @@ status: response.status, | ||
type: FAILURE, | ||
parentType: API_FAILURE, | ||
error: err.response ? err.response.data || err.response.statusText : err, | ||
@@ -161,3 +165,5 @@ status: err.response ? err.response.status : null, | ||
exports.default = apiClientMiddleware; | ||
exports.API_FAILURE = API_FAILURE; | ||
exports.API_SUCCESS = API_SUCCESS; | ||
exports.default = reduxApiMiddleware; | ||
//# sourceMappingURL=index.cjs.js.map |
@@ -109,3 +109,5 @@ function _defineProperty(obj, key, value) { | ||
function apiClientMiddleware(client) { | ||
var API_FAILURE = '@@redux-api-middleware/API_FAILURE'; | ||
var API_SUCCESS = '@@redux-api-middleware/API_SUCCESS'; | ||
function reduxApiMiddleware(client) { | ||
return function (_ref) { | ||
@@ -136,2 +138,3 @@ var dispatch = _ref.dispatch, | ||
type: SUCCESS, | ||
parentType: API_SUCCESS, | ||
payload: response.data, | ||
@@ -145,2 +148,3 @@ status: response.status, | ||
type: FAILURE, | ||
parentType: API_FAILURE, | ||
error: err.response ? err.response.data || err.response.statusText : err, | ||
@@ -157,3 +161,4 @@ status: err.response ? err.response.status : null, | ||
export default apiClientMiddleware; | ||
export default reduxApiMiddleware; | ||
export { API_FAILURE, API_SUCCESS }; | ||
//# sourceMappingURL=index.esm.js.map |
{ | ||
"name": "@sigfox/redux-api-middleware", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"private": false, | ||
@@ -64,3 +64,3 @@ "description": "Redux API middleware.", | ||
}, | ||
"gitHead": "f8c157978dec0af013d11bf08581d4dbc4799aa9" | ||
"gitHead": "139a22e6622ef07f0951d6ece60a9357fada95e9" | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
19734
271
0