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

axios-hooks

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-hooks - npm Package Versions

simoneb
published 2.2.0 •

Changelog

Source

2.2.0 (2020-11-18)

Bug Fixes

  • deps: update dependency lru-cache to v6 (e589be6)
  • typings: improve typing of the error and response properties on ResponseValues (4479a90)
simoneb
published 2.1.0 •

Changelog

Source

2.1.0 (2020-07-04)

Features

simoneb
published 2.1.0-0 •

simoneb
published 2.0.0 •

Changelog

Source

2.0.0 (2020-06-24)

⚠ BREAKING CHANGES

  • This release introduces a fundamental change in the caching mechanism.

The main difference is that requests that don't use the cache will store the response in the cache anyway, making the behavior of the library more intuitive and predictable.

In other words, { useCache: false } will only skip reading from the cache, but it will write the response to the cache in any case.

The docs contain a caching example providing a full overview of how the new caching behavior works.

A potential side effect of the new behavior, which we tried mitigating, is that the refetch function returned by the hook, which was always skipping the cache previously, now stores the response in cache. Because of this, it must generate a key for the cache, which is created based on the configuration provided as the first argument to the refetch function itself.

Because the refetch function is often provided directly to DOM event handlers:

<button onClick={refetch} />

this would no longer work because the first argument will be the React event and we cannot generate a cache key from that, and it wouldn't make much sense either. Because this is a fairly common scenario, we implemented a specific handling for this case. If the first argument is an event, it is ignored and considered as if no configuration override was provided.

Features

  • store response in cache when skipping cache for request (fff9ffe)
simoneb
published 2.0.0-2 •

simoneb
published 2.0.0-1 •

simoneb
published 1.11.0 •

Changelog

Source

1.11.0 (2020-06-21)

Features

  • 250: all axios-hooks-generated requests cancel each other (0de127e), closes #250
simoneb
published 1.10.1 •

Changelog

Source

1.10.1 (2020-06-21)

  • optimize re-rendering with correct initState (d7aef70)
simoneb
published 1.10.1-4 •

simoneb
published 1.10.1-3 •