Skip to content

GridLayer.detach

Summary

GridLayer.detach removes grid DOM nodes and clears internal pools. OverlaySystem calls this automatically when layers are removed or cleared.

Syntax

GridLayer.detach(): void
layer.detach();

Parameters

This method does not take parameters.

Returns

void - No return value.

Type Details

// No additional descriptor expansion is required for this signature.

Example

const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);

const overlay = wgpu.createOverlay.system();
const grid = wgpu.createOverlay.grid({ id: "grid-main" });
overlay.addLayer(grid);
overlay.removeLayer("grid-main"); // detach called internally

See Also