superwf / vuex-cache

cache vuex action when dispatch
MIT License
510 stars 32 forks source link

Change cache to a Map and expose it #1

Closed VitorLuizC closed 7 years ago

VitorLuizC commented 7 years ago

After used vuex-cache code for a while I realize it's methods is very similar to Map methods and doing some researches I also confirmed that Maps are better than pure objects(Object.create(null)).

So I'd changed cache constant to a Map instance, added dispatch method and expose it. Now all Map methods and dispatch is available under store.cache namespace. Also I'd changed the unit tests and README.

In fact, now this lib is faster and smaller, and the only side effects is IE11- that needs Map polyfill to run properly.