elmish / hmr

Hot Module Replacement for Elmish apps
https://elmish.github.io/hmr
Other
28 stars 9 forks source link

Inactive programs shouldn't save hmrState #37

Closed alfonsogarciacaro closed 2 years ago

alfonsogarciacaro commented 2 years ago

Not entirely sure why this hasn't surfaced before and why it's happening now to me (using Vite), but it looks in some situations the hot.dispose runs a bit late and, because mapUpdate replaces hmrState no matter whether the program is active or not, in the next update the Inactive state is loaded and Elmish freezes.

Only saving hmrState for active programs seem to fix this.