vuex-cache
Advanced tools
Changelog
3.4.0
Upgrade devDependencies.
Allow clear to delete all cached actions with same name.
Thanks to @lukasbesch for PR #51.
Changelog
3.3.0
dist/vuex-cache.esm.js
to dist/vuex-cache.es.js
because of bili
update.Changelog
3.1.0
Add mapCacheAction
function helper to call actions with cache on components.
import { mapCachedActions } from 'vuex-cache';
export default {
name: 'Users',
async mounted() {
this.GET_USER();
this.FETCH_REPOSITORY(219, {
timeout: 30000
});
}
methods: {
...mapCachedActions(['FETCH_REPOSITORY']),
...mapCachedActions('user', ['GET_USER'])
}
}
Changelog
3.0.0
Breaking Change: Module exports a factory to create plugin instead of the plugin itself.
import Vue from 'vue'
import Vuex, { Store } from 'vuex'
import createCache from 'vuex-cache'
Vue.use(Vuex)
const store = new Store({
plugins: [createCache()],
...
})
Breaking Change: store.cache.has()
returns false
for expired actions.
const store = new Store({
plugins: [createCache()],
actions: {
ACTION: () => {},
},
})
store.cache.has('ACTION')
//=> false
store.cache.dispatch('ACTION', undefined, {
timeout: 100,
})
store.cache.has('ACTION')
//=> true
setTimeout(() => {
store.cache.has('ACTION')
//=> false
}, 100)
This fixes issue #28.
Breaking Change: Cache is module scoped and don't support multiple instances anymore.
This fixes an issue with cacheAction
cache state different from plugin one.
Breaking Change: createCache
returns
This fixes an issue with cacheAction
cache state different from plugin one.
Breaking Change: Rename main source module and bundles.
index.js
is now vuex-cache.js
dist/vuex-cache.cjs.js
is now dist/vuex-cache.js
dist/vuex-cache.es.js
is now dist/vuex-cache.mjs
dist/vuex-cache.js
is now dist/vuex-cache.umd.js
dist/vuex-cache.min.js
is now dist/vuex-cache.umd.min.js
It now supports some of non JSON parseable values as arguments. Like functions, undefined
and other values.
This fixes issue #30.
It fallback dispatches to uncached if params have circular references.
This fixes issue #29.
Add JSDoc comments to functions and values.
Rename main module, functions and variables.
Refactor unit tests and split them into multiple modules.
Upgrade dependencies and bundle settings.
Create type definitions for TS developers & Editor/IDE intellisense.
This fixes issue #32.
Add MIT License.
Improve README.md
docs.
This fixes issue #21.
Add Installation on Nuxt.js section to README.md
.
This fixes issue #26.
Move Map
polyfill notice to Compatibility section.
Maybe fix the cause of issue #31.
Improve Installation section on README.md
.
Refactor Usage section and move it up.
Create API section with docs about cache
methods, Payload and Timeout.
Remove old docs about cache
methods, payload and timeout.
Change package.json
description and keywords.
Changelog
2.1.0
Improve documentation.
README.md
;CHANGELOG
file.README.md
.This is part of a pretty big docs improvement suggested by @vjee on issue #21.
Add @VitorLuizC to contributors on package.
Upgrade dependencies.
Remove unused babel
, eslint
and jest
plugins.
Improve bundle, test and lint
.eslintrc.js
.babel.config.js
..eslintignore
file.npx
and NODE_ENV
assignment on package scripts.Changelog
1.4.0
Adds an option to define default timeout on actions. timeout
option is optional and it's overwritten by action specific timeout
.
import Vuex, { Store } from 'vuex'
import cache from 'vuex-cache'
const store = new Vuex.Store({
plugins: [ cache({ timeout: 2000 }) ],
...
})
Improvement suggested by @hvaughan3 on #11.