I have some code like this , it could output correctly when app first loaded or refresh ,but don‘t work after HMR.
const pinia = createPinia();
pinia.use(({ store }) => {
store.$subscribe((mutations, state) => {
console.log('trigger subscritions ', mutations, state);
});
});
I have add some breakpoints in Pinia.js ,and found that subscriptions is emty [] after HMR.
// the "subscriptions" is empty [] after HMR
function triggerSubscriptions(subscriptions, ...args) {
subscriptions.forEach((callback) => {
callback(...args);
});
}
I have some code like this , it could output correctly when app first loaded or refresh ,but don‘t work after HMR.
I have add some breakpoints in Pinia.js ,and found that
subscriptionsis emty [] after HMR.