Releases: hazae41/glacier
Releases · hazae41/glacier
1.0.39 - The storage update
NO BREAKING CHANGES
CHANGES
- Split cache and storage
- Added support for async storages
- Added AsyncLocalStorage (SSR compatible) and SyncLocalStorage (no SSR)
- Fixed bugs on core unmount
- Improved performances by avoiding multiple get()
- Added tests for localStorage
1.0.37 - The time update
BREAKING CHANGES
- Changed
useSingle()
anduseScroll()
to use new time parameters
useSingle(key, fetcher, { cooldown, timeout, expiration })
useScroll(scroller, fetcher, { cooldown, timeout, expiration })
CHANGES
- You can now use an expiration delay in your handles
useSingle(key, fetcher, { expiration: 60 * 1000 })
useScroll(scroller, fetcher, { expiration: 60 * 1000 })
- You can now return a cooldown time in your fetcher
async function fetchAsJson<T>(url: string) {
const res = await fetch(url)
if (!res.ok) throw new Error(await res.text())
const data = await res.json() as T
const cooldown = Date.now() + 5000
const expiration = Date.now() + (60 * 1000)
return { data, cooldown, expiration }
}
- You can now use time parameters in CoreProvider
function MyWrapper() {
return <XSWR.CoreProvider
cooldown={1000}
timeout={5000}
expiration={60 * 1000}>
<MyAwesomeApp />
</XSWR.CoreProvider>
}
1.0.36 - The ES6 update
Now ES6 compatible, tree-shakeable and side-effects free!