New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

axios-hooks

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-hooks - npm Package Compare versions

Comparing version 1.1.0 to 1.1.2

src/index.test.js

28

CHANGELOG.md

@@ -5,37 +5,23 @@ # Changelog

## [1.1.0](https://github.com/simoneb/axios-hooks/compare/v1.0.2-alpha.1...v1.1.0) (2019-05-25)
### [1.1.2](https://github.com/simoneb/axios-hooks/compare/v1.1.1...v1.1.2) (2019-06-30)
### Features
* Add manual option to skip automatic execution ([a98fba2](https://github.com/simoneb/axios-hooks/commit/a98fba2)), closes [#6](https://github.com/simoneb/axios-hooks/issues/6)
### [1.1.1](https://github.com/simoneb/axios-hooks/compare/v1.1.0...v1.1.1) (2019-06-30)
### Tests
## [1.1.0](https://github.com/simoneb/axios-hooks/compare/v1.0.2-alpha.1...v1.1.0) (2019-05-25)
* Add tests ([a1412a5](https://github.com/simoneb/axios-hooks/commit/a1412a5))
### [1.0.2-alpha.1](https://github.com/simoneb/axios-hooks/compare/v1.0.2-alpha.0...v1.0.2-alpha.1) (2019-05-25)
## [1.1.0](https://github.com/simoneb/axios-hooks/compare/v1.0.1...v1.1.0) (2019-05-25)
### Features
- Add manual option to skip automatic execution ([a98fba2](https://github.com/simoneb/axios-hooks/commit/a98fba2)), closes [#6](https://github.com/simoneb/axios-hooks/issues/6)
### [1.0.2-alpha.0](https://github.com/simoneb/axios-hooks/compare/v1.0.2-0...v1.0.2-alpha.0) (2019-05-25)
### [1.0.2-0](https://github.com/simoneb/axios-hooks/compare/v1.0.2...v1.0.2-0) (2019-05-25)
### [1.0.2](https://github.com/simoneb/axios-hooks/compare/v1.0.1...v1.0.2) (2019-05-25)
### [1.0.1](https://github.com/simoneb/axios-hooks/compare/v1.0.0...v1.0.1) (2019-05-18)
# Changelog
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

@@ -50,3 +50,3 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";

}
}, _callee, this);
}, _callee);
}));

@@ -97,3 +97,3 @@ return _serializeCache.apply(this, arguments);

}
}, _callee2, this);
}, _callee2);
}));

@@ -173,3 +173,3 @@ return _cacheAdapter.apply(this, arguments);

}
}, _callee3, this, [[0, 8]]);
}, _callee3, null, [[0, 8]]);
}));

@@ -176,0 +176,0 @@ return _request.apply(this, arguments);

@@ -9,3 +9,3 @@ "use strict";

exports.serializeCache = serializeCache;
exports.default = useAxios;
exports["default"] = useAxios;

@@ -29,4 +29,4 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

var ssrPromises = [];
var cache = new _lruCache.default();
var axiosInstance = _axios.default;
var cache = new _lruCache["default"]();
var axiosInstance = _axios["default"];

@@ -52,6 +52,6 @@ function configure(options) {

function _serializeCache() {
_serializeCache = (0, _asyncToGenerator2.default)(
_serializeCache = (0, _asyncToGenerator2["default"])(
/*#__PURE__*/
_regenerator.default.mark(function _callee() {
return _regenerator.default.wrap(function _callee$(_context) {
_regenerator["default"].mark(function _callee() {
return _regenerator["default"].wrap(function _callee$(_context) {
while (1) {

@@ -72,3 +72,3 @@ switch (_context.prev = _context.next) {

}
}, _callee, this);
}, _callee);
}));

@@ -83,7 +83,7 @@ return _serializeCache.apply(this, arguments);

function _cacheAdapter() {
_cacheAdapter = (0, _asyncToGenerator2.default)(
_cacheAdapter = (0, _asyncToGenerator2["default"])(
/*#__PURE__*/
_regenerator.default.mark(function _callee2(config) {
_regenerator["default"].mark(function _callee2(config) {
var cacheKey, hit, response, responseForCache;
return _regenerator.default.wrap(function _callee2$(_context2) {
return _regenerator["default"].wrap(function _callee2$(_context2) {
while (1) {

@@ -109,3 +109,3 @@ switch (_context2.prev = _context2.next) {

response = _context2.sent;
responseForCache = (0, _extends3.default)({}, response);
responseForCache = (0, _extends3["default"])({}, response);
delete responseForCache.config;

@@ -121,3 +121,3 @@ delete responseForCache.request;

}
}, _callee2, this);
}, _callee2);
}));

@@ -138,3 +138,3 @@ return _cacheAdapter.apply(this, arguments);

case actions.REQUEST_START:
return (0, _extends3.default)({}, state, {
return (0, _extends3["default"])({}, state, {
loading: true

@@ -144,3 +144,3 @@ });

case actions.REQUEST_END:
return (0, _extends3.default)({}, state, {
return (0, _extends3["default"])({}, state, {
loading: false

@@ -161,7 +161,7 @@ }, action.error ? {} : {

function _request() {
_request = (0, _asyncToGenerator2.default)(
_request = (0, _asyncToGenerator2["default"])(
/*#__PURE__*/
_regenerator.default.mark(function _callee3(config, dispatch) {
_regenerator["default"].mark(function _callee3(config, dispatch) {
var response;
return _regenerator.default.wrap(function _callee3$(_context3) {
return _regenerator["default"].wrap(function _callee3$(_context3) {
while (1) {

@@ -200,3 +200,3 @@ switch (_context3.prev = _context3.next) {

}
}, _callee3, this, [[0, 8]]);
}, _callee3, null, [[0, 8]]);
}));

@@ -207,3 +207,3 @@ return _request.apply(this, arguments);

function executeRequestWithCache(config, dispatch) {
request((0, _extends3.default)({}, config, {
request((0, _extends3["default"])({}, config, {
adapter: cacheAdapter

@@ -230,3 +230,3 @@ }), dispatch);

var _React$useReducer = _react.default.useReducer(reducer, createInitialState(options)),
var _React$useReducer = _react["default"].useReducer(reducer, createInitialState(options)),
state = _React$useReducer[0],

@@ -236,3 +236,3 @@ dispatch = _React$useReducer[1];

if (typeof window === 'undefined') {
ssrPromises.push(axiosInstance((0, _extends3.default)({}, config, {
ssrPromises.push(axiosInstance((0, _extends3["default"])({}, config, {
adapter: cacheAdapter

@@ -242,3 +242,3 @@ })));

_react.default.useEffect(function () {
_react["default"].useEffect(function () {
if (!options.manual) {

@@ -250,4 +250,4 @@ executeRequestWithCache(config, dispatch);

return [state, function (configOverride) {
return executeRequestWithoutCache((0, _extends3.default)({}, config, configOverride), dispatch);
return executeRequestWithoutCache((0, _extends3["default"])({}, config, configOverride), dispatch);
}];
}
{
"name": "axios-hooks",
"version": "1.1.0",
"version": "1.1.2",
"description": "axios-hooks",

@@ -17,2 +17,3 @@ "keywords": [

"module": "es/index.js",
"typings": "./index.d.ts",
"files": [

@@ -24,14 +25,15 @@ "lib",

"scripts": {
"build:commonjs": "cross-env BABEL_ENV=commonjs babel src --out-dir lib",
"build:es": "babel src --out-dir es",
"build:commonjs": "cross-env BABEL_ENV=commonjs babel src/index.js --out-dir lib",
"build:es": "babel src/index.js --out-dir es",
"build": "run-p build:*",
"clean": "rimraf lib es coverage",
"format": "prettier --write \"src/**/*.{js,md}\"",
"format": "prettier --write \"src/**/*.{js,md,ts}\"",
"lint": "eslint src",
"prepare": "npm run clean && npm run build",
"prepublishOnly": "npm run build",
"release": "standard-version"
"release": "standard-version",
"test": "jest"
},
"dependencies": {
"@babel/runtime": "^7.3.1",
"@babel/runtime": "^7.4.5",
"lru-cache": "^5.1.1"

@@ -44,6 +46,6 @@ },

"devDependencies": {
"@babel/cli": "^7.2.3",
"@babel/core": "^7.3.3",
"@babel/plugin-transform-runtime": "^7.2.0",
"@babel/preset-env": "^7.3.1",
"@babel/cli": "^7.4.4",
"@babel/core": "^7.4.5",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.4.5",
"axios": "^0.18.0",

@@ -53,12 +55,15 @@ "babel-eslint": "^10.0.1",

"cz-conventional-changelog": "^2.1.0",
"eslint": "^5.14.0",
"eslint-config-prettier": "^4.0.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-prettier": "^3.0.1",
"eslint": "^5.16.0",
"eslint-config-prettier": "^4.3.0",
"eslint-plugin-import": "^2.17.3",
"eslint-plugin-prettier": "^3.1.0",
"husky": "^1.3.1",
"lint-staged": "^8.1.4",
"jest": "^24.8.0",
"lint-staged": "^8.1.7",
"npm-run-all": "^4.1.5",
"prettier": "^1.16.4",
"react": "^16.8.2",
"react-dom": "^16.8.2",
"prettier": "^1.17.1",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-hooks-testing-library": "^0.5.0",
"react-test-renderer": "^16.8.6",
"rimraf": "^2.6.3",

@@ -65,0 +70,0 @@ "standard-version": "^6.0.1"

@@ -58,2 +58,3 @@ # axios-hooks

- [Configuration](#configuration)
- [Manual Requests](#manual-requests)
- [Server Side Rendering](#server-side-rendering)

@@ -60,0 +61,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc