This package provides both a default export, which is intended to be the "main" Fetch function as used in the documentation. However, there's also a named { Fetch } export, which is a renamed createRemoteAssetCache. There was some confusion over this; a user wrote { Fetch }, which did not throw an error, but instead mysteriously returned a RemoteAssetCache object even though {type: 'json'} was passed.
My guess is that this was done for backwards compatibility, but it is confusing for developers nevertheless, especially because the docs isn't very up-front about this. It shows the default import only, sure, but it is an easy mistake to add the curlies, and the lack of an immediate error makes it easy to miss.
For the next major release I would suggest renaming the exports; either do not export a named { Fetch } at all, or have it be an alias to the default export; the createRemoteAssetCache function can be exported under its own name.
This package provides both a default export, which is intended to be the "main"
Fetchfunction as used in the documentation. However, there's also a named{ Fetch }export, which is a renamedcreateRemoteAssetCache. There was some confusion over this; a user wrote{ Fetch }, which did not throw an error, but instead mysteriously returned aRemoteAssetCacheobject even though{type: 'json'}was passed.My guess is that this was done for backwards compatibility, but it is confusing for developers nevertheless, especially because the docs isn't very up-front about this. It shows the default import only, sure, but it is an easy mistake to add the curlies, and the lack of an immediate error makes it easy to miss.
For the next major release I would suggest renaming the exports; either do not export a named
{ Fetch }at all, or have it be an alias to the default export; thecreateRemoteAssetCachefunction can be exported under its own name.