Releases: tuax/tua-storage
Releases · tuax/tua-storage
v1.8.2
v1.8.1
v1.8.0
Now you can use ESM in browser, see this demo
<!-- unpkg -->
<script type="module">
import TuaStorage from 'https://unpkg.com/tua-storage/dist/tua-storage.esm.browser.js'
const tuaStorage = new TuaStorage({
storageEngine: localStorage,
})
tuaStorage
.load({
key: 'test',
syncFn: () => Promise.resolve('test data'),
})
.then(console.log)
.catch(console.error)
</script>
<!-- jsdelivr -->
<script type="module">
import TuaStorage from 'https://cdn.jsdelivr.net/npm/tua-storage/dist/tua-storage.esm.browser.js'
const tuaStorage = new TuaStorage({
storageEngine: localStorage,
})
tuaStorage
.load({
key: 'test',
syncFn: () => Promise.resolve('test data'),
})
.then(console.log)
.catch(console.error)
</script>
Bug Fixes
- fix: avoid sending request twice, avoid using key as cacheData
Enhancements
- feat: esm in browser (#29)
v1.7.3
v1.7.2
v1.7.1
v1.7.0
-
feat: close #22, add syncOptions
-
refactor(test): use async/await, map -> forEach
-
fix: replace
process.env.NODE_ENV
, so we can use it in the browser