subscriptions are lost during HMR
See original GitHub issueI 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);
});
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Frequently Asked Questions - HMR Diet Program
Read responses to frequently asked questions about the HMR weight management ... What if I want to continue to lose weight after I...
Read more >The HMR Diet Promises To Help You Lose Weight Fast—But ...
HMR promises easy results using pre-prepared foods (shakes and meals) and a highly structured format to help followers drop a lot of weight...
Read more >I Tried the HMR Diet and It Was Hard—But Not for the Reason ...
The HMR diet is designed for swift weight loss by replacing your normal foods with HMR foods. As we learned in group, these...
Read more >Brad & Jenny lost 400 lbs. together on HMR - YouTube
HMR Weight Management Services ( HMR ), a subsidiary of Merck, has been named a No. 1 Best Fast Weight- Loss Diet in...
Read more >Losing *only* two pounds … A 19-week reflection on the HMR ...
Last night was my 133rd day staying "in the box" on the HMR Decision Free diet. On my first night of class, my...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@posva sure, created PR with docs update https://github.com/vuejs/pinia/pull/1781 👍
I think it would be very useful to mention it in
plugins
section of docs, especially in the$subscribe
section as if you develop a plugin and use$subscribe
or$onAction
, you almost certainly want to usedetach: true