Skip to content

@wanner.work/image-2.0.0

Compare
Choose a tag to compare
@jwanner83 jwanner83 released this 13 May 10:24
· 2 commits to main since this release

[2.0.0] - 2024-05-13

Breaking

  • The cache configuration has moved from useCache and cacheMaxAge={...} on the ImageProvider component to the
    cache prop. The cache 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 and preloadImage

Full Changelog: https://github.com/wanner-work/components/compare/@wanner.work/[email protected]/image-2.0.0