Breaking Changes
- Response caching is now built in, and enabled by default.
- Project renamed to
bestfetch
(fromfetch-dedupe
)
Breaking Changes
- When an attempt to call
response[responseType]()
errors, thenresponse.data
will be set asnull
. This can be useful if you specify theresponseType
asjson
, and the backend returns malformed JSON (such as an empty string or plain text). Instead of this error going uncaught, the fetch will work as expected.
Bug Fixes
- Resolves a problem where you were unable to use the signature
fetch(input, init)
.
New Features
responseType
can now be specified as a function. This is useful for backends that don't respect theAccept
header. "Enterprisey" backends frequently return text stack traces for errors, as an example.
Breaking
dedupeOptions
is now optional. TheresponseType
is"json"
by default, unless the status code is 204, in which case it will be"text"
.
New features
init
is now optional- A
requestKey
will be generated for you if it is omitted
This is the first release of the library.