Closed henriq-88 closed 5 years ago
each time when call users.push('Nisse') delete the cache key 'getUsers' by using the 'delete' method store.cache.delete('getUsers') next time the cache.dispatch will make a real dispatch to fetch the latest data
My hope was that it would automatically delete the cache when calling the native function.
Anyways thanks for the explanation.
It does not automatically delete the cache when you dispatch "native" actions.
@henriq-88, docs are confuse enough to make you think it'll work or its a enhancement suggestion?
If it's a suggestion I can reopen this issue and put suggestion label in it.
Yes, it is a suggestion. That would be great, thanks!
I don't think this is a good idea because it will cause a breaking change, it's hard to explain and can cause undesirable behaviors.
What do you think about this behavior, @superwf?
@henriq-88, can you link other libraries with same behavior or just improve this suggestion with some cases and improvements that can do?
hello, it would be great if we could add an option in cache.dispatch if we really want to replace the cache (for example, we already know that the response should be changed because we have mutated in certain way). For now, it's kinda pain to duplicate the delete after each change.
Should a native action call (e.g. without
.cache
) update an already existing cache? Or is the sequence below intended?