You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We shouldn't ignore any value, even undefined should be used to generate cache's key.
This can be checked by running the code below.
importVuefrom'vue';importVuex,{Store}from'vuex';importcachefrom'vuex-cache';Vue.use(Vuex);conststore=newStore({plugins: [cache({})],actions: {hi(_,payload){console.log('Hi',payload);}}});store.cache.dispatch('hi',undefined);// It shows 'Hi undefined'store.cache.dispatch('hi',null);// It don't show anythingstore.cache.dispatch('hi',0);// It don't show anythingstore.cache.dispatch('hi','');// It don't show anythingstore.cache.dispatch('hi',NaN);// It don't show anythingstore.cache.dispatch('hi',false);// It don't show anything
The
argsToString
function ignore falsy values.vuex-cache/src/index.js
Lines 10 to 12 in 637815b
We shouldn't ignore any value, even
undefined
should be used to generate cache's key.This can be checked by running the code below.
See by yourself on CodeSandbox.
The text was updated successfully, but these errors were encountered: