axios-hooks
Advanced tools
Comparing version 2.6.0 to 2.6.1
@@ -5,2 +5,4 @@ # Changelog | ||
### [2.6.1](https://github.com/simoneb/axios-hooks/compare/v2.6.0...v2.6.1) (2021-03-30) | ||
## [2.6.0](https://github.com/simoneb/axios-hooks/compare/v2.5.1...v2.6.0) (2021-03-28) | ||
@@ -7,0 +9,0 @@ |
@@ -25,4 +25,3 @@ "use strict"; | ||
REQUEST_START: 'REQUEST_START', | ||
REQUEST_END: 'REQUEST_END', | ||
REQUEST_CANCELED: 'REQUEST_CANCELED' | ||
REQUEST_END: 'REQUEST_END' | ||
}; | ||
@@ -188,7 +187,2 @@ var DEFAULT_OPTIONS = { | ||
}, (_extends2 = {}, _extends2[action.error ? 'error' : 'response'] = action.payload, _extends2)); | ||
case actions.REQUEST_CANCELED: | ||
return (0, _extends3["default"])({}, state, { | ||
loading: false | ||
}); | ||
} | ||
@@ -252,6 +246,2 @@ } | ||
}); | ||
} else { | ||
dispatch({ | ||
type: actions.REQUEST_CANCELED | ||
}); | ||
} | ||
@@ -258,0 +248,0 @@ |
@@ -10,4 +10,3 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator"; | ||
REQUEST_START: 'REQUEST_START', | ||
REQUEST_END: 'REQUEST_END', | ||
REQUEST_CANCELED: 'REQUEST_CANCELED' | ||
REQUEST_END: 'REQUEST_END' | ||
}; | ||
@@ -170,7 +169,2 @@ var DEFAULT_OPTIONS = { | ||
}, (_extends2 = {}, _extends2[action.error ? 'error' : 'response'] = action.payload, _extends2)); | ||
case actions.REQUEST_CANCELED: | ||
return _extends({}, state, { | ||
loading: false | ||
}); | ||
} | ||
@@ -234,6 +228,2 @@ } | ||
}); | ||
} else { | ||
dispatch({ | ||
type: actions.REQUEST_CANCELED | ||
}); | ||
} | ||
@@ -240,0 +230,0 @@ |
{ | ||
"name": "axios-hooks", | ||
"version": "2.6.0", | ||
"version": "2.6.1", | ||
"description": "axios-hooks", | ||
@@ -45,4 +45,4 @@ "keywords": [ | ||
"devDependencies": { | ||
"@babel/cli": "7.13.10", | ||
"@babel/core": "7.13.13", | ||
"@babel/cli": "7.13.14", | ||
"@babel/core": "7.13.14", | ||
"@babel/plugin-transform-runtime": "7.13.10", | ||
@@ -49,0 +49,0 @@ "@babel/preset-env": "7.13.12", |
@@ -8,4 +8,3 @@ import React from 'react' | ||
REQUEST_START: 'REQUEST_START', | ||
REQUEST_END: 'REQUEST_END', | ||
REQUEST_CANCELED: 'REQUEST_CANCELED' | ||
REQUEST_END: 'REQUEST_END' | ||
} | ||
@@ -158,4 +157,2 @@ | ||
} | ||
case actions.REQUEST_CANCELED: | ||
return { ...state, loading: false } | ||
} | ||
@@ -193,5 +190,4 @@ } | ||
dispatch({ type: actions.REQUEST_END, payload: err, error: true }) | ||
} else { | ||
dispatch({ type: actions.REQUEST_CANCELED }) | ||
} | ||
throw err | ||
@@ -198,0 +194,0 @@ } |
56393
829