0๐
โ
Iโve finally found the solution:
I had to add the extra option flush: 'sync'
to store.$subscribe
.
The flush
option does not affect calls to store.$patch() and this fixed my problem.
store.$subscribe(
(mutation, state) => {
...
},
{ flush: 'sync' } <<< ----------- HERE
);
Source:stackexchange.com