mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
46
blocksuite/docs/api/@blocksuite/std/gfx/functions/watch.md
Normal file
46
blocksuite/docs/api/@blocksuite/std/gfx/functions/watch.md
Normal file
@@ -0,0 +1,46 @@
|
||||
[**BlockSuite API Documentation**](../../../../README.md)
|
||||
|
||||
***
|
||||
|
||||
[BlockSuite API Documentation](../../../../README.md) / [@blocksuite/std](../../README.md) / [gfx](../README.md) / 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`\>
|
||||
Reference in New Issue
Block a user