michaelolof / vuex-class-component

A Type Safe Vuex Module or Store Using ES6 Classes and ES7 Decorators written in TypeScript.
217 stars 21 forks source link

Improved testability; added possiblility to clear proxy cache #18

Closed asmadsen closed 5 years ago

asmadsen commented 5 years ago

When extracting the vuex module, it will do a copy of the values so if we run ExtractVuexModule again the values will reset to the initially defined values in the class.

Added the method ClearProxyCache which will delete the proxy cache.

michaelolof commented 5 years ago

Hello Thanks for your contribution so far.

I've been quite busy this couple of days. Some questions about the PR you made.

What are the use cases for the clear cache feature.

Thanks a lot.

asmadsen commented 5 years ago

Because of the caching feature, when you are unit testing the components you would usually send in a new store for each test. However since it caches the proxy, the subsequent times you where to call CreateProxy it would use the old proxy which interacts with the store from a previous test.