import type {Document,Id} from '../canvas-core/types.ts'; import {equal,fault} from '../canvas-core/values.ts'; import type {projectCanvas} from './projection.ts'; type Projection=ReturnType; type Retained={incarnation:number;ownerCanvasId:Id;value:T}; /** View-owned rendering cache, never a document store. Keep unchanged React Flow input identities. */ export function createProjectionCache(){ let scope:object|undefined,projectId:Id|undefined,canvasId:Id|undefined; let nodes=new Map>(),edges=new Map>(); function retain(document:Document,values:T[],previous:Map>){ const next=new Map>(); for(let index=0;index