Facet.compute method
Facet › compute
Official
Create an extension that computes a value for the facet from a state.Signature:
compute(deps: readonly ("doc" | "selection" | FacetReader<unknown> | StateField<unknown>)[], get: (state: EditorState) => Input): ExtensionParameters:
| Parameter | Type | Description |
|---|---|---|
| deps | readonly ("doc" | "selection" | FacetReader<unknown> | StateField<unknown>)[] | The dependencies. |
| get | (state: EditorState) => Input | The getter function. |
Returns: Extension — The extension.