Files
AFFiNE-Mirror/blocksuite/docs/api/@blocksuite/block-std/gfx/functions/watch.md
2025-03-17 12:51:08 +00:00

885 B

@blocksuite/block-std


BlockSuite API Documentation / @blocksuite/block-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

Function

Parameters

_

unknown

context

ClassAccessorDecoratorContext

Returns

ClassAccessorDecoratorResult<GfxPrimitiveElementModel<BaseElementProps>, V>