@wanner.work/image-2.0.0
[2.0.0] - 2024-05-13
Breaking
- The cache configuration has moved from
useCache
andcacheMaxAge={...}
on theImageProvider
component to the
cache
prop. Thecache
prop is an object with the following properties:enabled
(boolean),maxAge
(number), and
some new ones. (see below)
Added
- Added the option to set your own cache key per image. This makes sure, e.g. notion images can be cached as well, even
if the url, which is returned by the api, changes every single time even tho the image itself is the same. - Created a
useImage
hook which handles all of the caching and loading if more flexibility is needed. - Exported useful methods
getImageDataURL
andpreloadImage
Full Changelog: https://github.com/wanner-work/components/compare/@wanner.work/[email protected]/image-2.0.0