Hooks
useDrawing#
Hook to select parts of the drawing state.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| id | DrawingID | The drawing id. | |
| sel | (state: DrawingState) => T l undefined | The selector of the drawing state. | |
| equalityFn? | ((a: T l undefined, b: T l undefined) => boolean) l undefined | The equality function. |
Returns T | undefined
The part of the drawing state selected by the selector function (sel). Result can be undefined!
usePlugin#
Hook to select parts of the plugin state.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| drawingId | DrawingID | The drawing id. | |
| pluginId | PluginID | The plugin id. | |
| sel | (state: PluginState) => T l undefined | The selector of the plugin state. | |
| equalityFn? | ((a: T l undefined, b: T l undefined) => boolean) l undefined | The equality function. |
Returns T | undefined
The part of the plugin state selected by the selector function (sel). Result can be undefined!