0

I am unable to retrieve the correct value of a pinia store property while subscribing to a store.

The following screenshot demonstrates my confusion. Why i am unable to retrieve the updated value of lastMutation?

debug_console

The update that triggers the store.$subscribe, is an update to lastMutation from 0 to 1668671191642.

I am expecting that state.lastMutation should be 1668671191642 and not 0.

Thank you for any hints.

1 Answer 1

0

Solved. We were hitting a bug, where a $subscribe is missing mutations after a $patch is performed.

Adding, sync: true to the subscription fixes the issue.

https://github.com/vuejs/pinia/issues/992

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.