Vue Track
11:15 - 11:25
Component Lifecycle and How to Handle Global State
VueUse composables assume they run inside a component and clean themselves up on unmount. Turning one into a singleton in your own composable creates a subtle bug: the first caller unmounts, the variable survives, but its internals silently break. VueUse has createGlobalState for exactly this case. I'll share what I learned from shipping that bug.
Ryutaro Yako
Ryutaro Yako
Component Lifecycle and How to Handle Global State
VueUse composables assume they run inside a component and clean themselves up on unmount. Turning one into a singleton in your own composable creates a subtle bug: the first caller unmounts, the variable survives, but its internals silently break. VueUse has createGlobalState for exactly this case. I'll share what I learned from shipping that bug.
