Skip to main content

Function: saveRenderingChoice()

saveRenderingChoice(name, rendering, storage?): void

Defined in: src/lib/storage/index.ts:482

Keep the rendering chosen with the app settings of a name, to be read with loadRenderingChoice when the canvas is next made. Does nothing if the storage can't be written.

Parameters​

name​

string

rendering​

"cpu" | "gpu"

storage?​

Pick<Storage, "setItem"> | undefined = globalThis.localStorage

Returns​

void

Example​

canvas.ui.addEventListener("change", () => saveRenderingChoice("demo", canvas.ui.data.rendering));