redux-api-middleware
Advanced tools
Comparing version 3.0.0-beta.2 to 3.0.0-beta.3
@@ -73,3 +73,3 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
} catch (e) { | ||
return next((await actionWith(_extends({}, requestType, { | ||
return next((await actionWith(_extends({}, failureType, { | ||
payload: new RequestError('[RSAA].bailout function failed'), | ||
@@ -85,3 +85,3 @@ error: true | ||
} catch (e) { | ||
return next((await actionWith(_extends({}, requestType, { | ||
return next((await actionWith(_extends({}, failureType, { | ||
payload: new RequestError('[RSAA].endpoint function failed'), | ||
@@ -98,3 +98,3 @@ error: true | ||
} catch (e) { | ||
return next((await actionWith(_extends({}, requestType, { | ||
return next((await actionWith(_extends({}, failureType, { | ||
payload: new RequestError('[RSAA].body function failed'), | ||
@@ -111,3 +111,3 @@ error: true | ||
} catch (e) { | ||
return next((await actionWith(_extends({}, requestType, { | ||
return next((await actionWith(_extends({}, failureType, { | ||
payload: new RequestError('[RSAA].headers function failed'), | ||
@@ -124,3 +124,3 @@ error: true | ||
} catch (e) { | ||
return next((await actionWith(_extends({}, requestType, { | ||
return next((await actionWith(_extends({}, failureType, { | ||
payload: new RequestError('[RSAA].options function failed'), | ||
@@ -127,0 +127,0 @@ error: true |
@@ -66,3 +66,3 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
*/ | ||
async function actionWith(descriptor, args) { | ||
async function actionWith(descriptor, args = []) { | ||
try { | ||
@@ -69,0 +69,0 @@ descriptor.payload = typeof descriptor.payload === 'function' ? await descriptor.payload(...args) : descriptor.payload; |
@@ -220,2 +220,4 @@ 'use strict'; | ||
function actionWith(descriptor, args) { | ||
if ( args === void 0 ) args = []; | ||
return new Promise(function ($return, $error) { | ||
@@ -344,3 +346,3 @@ var $Try_1_Post = function () { | ||
try { | ||
return actionWith(Object.assign({}, requestType, | ||
return actionWith(Object.assign({}, failureType, | ||
{payload: new RequestError('[RSAA].endpoint function failed'), | ||
@@ -376,3 +378,3 @@ error: true}), [action,getState()]).then(function ($await_14) { | ||
try { | ||
return actionWith(Object.assign({}, requestType, | ||
return actionWith(Object.assign({}, failureType, | ||
{payload: new RequestError('[RSAA].body function failed'), | ||
@@ -408,3 +410,3 @@ error: true}), [action,getState()]).then(function ($await_15) { | ||
try { | ||
return actionWith(Object.assign({}, requestType, | ||
return actionWith(Object.assign({}, failureType, | ||
{payload: new RequestError('[RSAA].headers function failed'), | ||
@@ -440,3 +442,3 @@ error: true}), [action,getState()]).then(function ($await_16) { | ||
try { | ||
return actionWith(Object.assign({}, requestType, | ||
return actionWith(Object.assign({}, failureType, | ||
{payload: new RequestError('[RSAA].options function failed'), | ||
@@ -581,3 +583,3 @@ error: true}), [action,getState()]).then(function ($await_17) { | ||
try { | ||
return actionWith(Object.assign({}, requestType, | ||
return actionWith(Object.assign({}, failureType, | ||
{payload: new RequestError('[RSAA].bailout function failed'), | ||
@@ -584,0 +586,0 @@ error: true}), [action,getState()]).then(function ($await_24) { |
{ | ||
"name": "redux-api-middleware", | ||
"version": "3.0.0-beta.2", | ||
"version": "3.0.0-beta.3", | ||
"description": "Redux middleware for calling an API.", | ||
@@ -13,6 +13,6 @@ "source": "src/index.js", | ||
"postbuild": "npm run size", | ||
"clean": "rimraf es lib coverage .nyc_output", | ||
"test": "cross-env BABEL_ENV=test babel-node test/index.js | tap-spec", | ||
"cover": "nyc npm test", | ||
"lint": "eslint src test", | ||
"clean": "rimraf es lib coverage", | ||
"test": "cross-env BABEL_ENV=test jest", | ||
"cover": "npm test -- --verbose --coverage --collectCoverageFrom \"src/**/*.js\"", | ||
"lint": "eslint src", | ||
"prepublishOnly": "npm run lint && npm test && npm run clean && npm run build", | ||
@@ -38,3 +38,2 @@ "size": "size-limit" | ||
"babel-cli": "^6.26.0", | ||
"babel-plugin-istanbul": "^4.1.6", | ||
"babel-plugin-transform-object-rest-spread": "^6.26.0", | ||
@@ -45,12 +44,10 @@ "babel-preset-env": "^1.7.0", | ||
"eslint": "^4.19.1", | ||
"eslint-plugin-jest": "^21.17.0", | ||
"eslint-plugin-prettier": "^2.6.0", | ||
"isomorphic-fetch": "^2.2.1", | ||
"jest": "^23.4.1", | ||
"jest-fetch-mock": "^1.6.5", | ||
"microbundle": "^0.5.1", | ||
"nock": "^9.3.3", | ||
"nyc": "^12.0.2", | ||
"prettier": "^1.13.5", | ||
"rimraf": "^2.6.2", | ||
"size-limit": "^0.18.2", | ||
"tap-spec": "^5.0.0 ", | ||
"tape": "^4.9.1" | ||
"size-limit": "^0.18.2" | ||
}, | ||
@@ -62,3 +59,12 @@ "files": [ | ||
"lib" | ||
] | ||
], | ||
"jest": { | ||
"automock": false, | ||
"resetMocks": true, | ||
"restoreMocks": true, | ||
"resetModules": true, | ||
"setupFiles": [ | ||
"./test/setupJest.js" | ||
] | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
240268
14
17
3130
14