MCPcopy Index your code
hub / github.com/ChartGPU/ChartGPU / cleanup

Function cleanup

examples/worker-convenience/main.ts:154–162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

152 // Cleanup
153 let cleanedUp = false;
154 const cleanup = (): void => {
155 if (cleanedUp) return;
156 cleanedUp = true;
157 clearInterval(updateInterval);
158 ro1.disconnect();
159 ro2.disconnect();
160 chart1.dispose();
161 chart2.dispose();
162 };
163
164 window.addEventListener('beforeunload', cleanup);
165 import.meta.hot?.dispose(cleanup);

Callers

nothing calls this directly

Calls 1

disposeMethod · 0.65

Tested by

no test coverage detected