createTransientValue
Creates a channel carrying one reading per environment.
@internote/canvas-sdkOn this page
import { createTransientValue } from '@internote/canvas-sdk';Declared at module scope beside the surface that publishes it: the channel is the contract between an environment's surface and its own footer, and nothing outside that pair should be reading it. The surface calls set from a pointer handler; the footer reads it with useTransient.
#Signature
<T>(equal?: TransientEqual<T>): TransientValue<T>#Parameters
equalWhether two readings are the same, so a repeat does not wake subscribers. Absent compares by identity.
#Example
export const cursorReading = createTransientValue<{ x: number; y: number }>(
(a, b) => a.x === b.x && a.y === b.y,
);
// In the surface:
cursorReading.set(ctx, { x, y });
// In the footer bar:
const cursor = useTransient(cursorReading, ctx);Declared in packages/canvas-sdk/src/storage/transient.ts:100.