Files
AFFiNE-Mirror/blocksuite/docs/api/@blocksuite/std/gfx/functions/watch.md
T
2026-06-24 23:55:19 +08:00

776 B

BlockSuite API Documentation


BlockSuite API Documentation / @blocksuite/std / gfx / watch

Function: watch()

watch<V, T>(fn): (_, context) => ClassAccessorDecoratorResult<GfxPrimitiveElementModel<BaseElementProps>, V>

The watch decorator is used to watch the property change of the element. You can thinks of it as a decorator version of elementUpdated slot of the surface model.

Type Parameters

V

V

T

T extends GfxPrimitiveElementModel<BaseElementProps>

Parameters

fn

WatchFn<T>

Returns

(_, context) => ClassAccessorDecoratorResult<GfxPrimitiveElementModel<BaseElementProps>, V>