northamerican / viz

Live music video streams for your spotify and youtube playlists.
0 stars 0 forks source link

hot reload: manage event listeners, video processes #48

Open northamerican opened 2 months ago

northamerican commented 2 months ago

on hot reload

this is just for development, so don't have a big shit.

see: https://vitejs.dev/guide/api-hmr

something like this

if (import.meta.hot) {
  import.meta.hot.accept();
  import.meta.hot.dispose(() => {
    // Clear timeouts, intervals, or any other cleanup tasks
    clearTimeout(yourTimeout);
    clearInterval(yourInterval);
    // Perform other necessary cleanup tasks here
  });