Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
vuex-cache
Advanced tools
When vuex action fetch some data by request remote api, vuex-cache can store the action result, when next time the same action runs, it will not make a new request and just return the cached result.
npm install vuex-cache
import Vuex from 'vuex'
import vuexCache from 'vuex-cache'
const store = new Vuex.Store({
state: {
...
},
plugins: [vuexCache],
mutations: {
...
},
actions: {
...
}
})
store.cacheDispatch('LIST')
store.cacheDispatch(ACTION_NAME)
params is same with vuex store.dispatch
cacheDispatch will cache the result, so do not use it to make some actions with different params, when params change, cacheDispatch would still return the first cached result, and the data in store will not change.
store.removeCache(ACTION_NAME)
remove cached action, will not remove the data in store. when call cacheDispatch with same type, the request in that action will run again.
store.hasCache(ACTION_NAME)
return bool if ACTION_NAME has been cached
store.clearCache()
clear all cached keys
FAQs
Cache dispatched actions and prevent repeated requests and heavy actions.
The npm package vuex-cache receives a total of 3,451 weekly downloads. As such, vuex-cache popularity was classified as popular.
We found that vuex-cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.