superwf / vuex-cache

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

When dispatching `this` not bound correctly #43

Closed kierans closed 4 years ago

kierans commented 4 years ago

This issue relates to #41 as I'm wanting to mock/fake the StoreCache for Component tests.

When dispatching (see vuex-cache.js#L297, #L305) this is bound to the store not the store cache. Given the cache.dispatch method doesn't use this, this bug probably hasn't surfaced yet. However when mocking/faking store.cache the cache methods are being called with the wrong this.

VitorLuizC commented 4 years ago

Published under version 3.1.1

https://github.com/superwf/vuex-cache/blob/master/CHANGELOG.md#311