@tanstack/svelte-table
Version:
Headless UI for building powerful tables & datagrids for Svelte.
14 lines (13 loc) • 680 B
TypeScript
/**
* Creates a stable object that forwards every read to `getTarget()`.
*
* `App*` wrappers provide a cell or header through context once, while the
* instance behind them can change (e.g. `data` is replaced and a keyed
* `{#each}` reuses the component with a new cell). Reading `getTarget()` inside
* a reactive scope also tracks the source prop, so consumers update with it.
*
* Prototype methods are called with the current instance as `this`, so
* per-instance memos never see the proxy. The forwarders are cached per key so
* method identity stays stable across target changes.
*/
export declare function createLiveProxy<T extends object>(getTarget: () => T): T;