Skip to content

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): Extension

Parameters:

Parameter Type Description
deps readonly ("doc" | "selection" | FacetReader<unknown> | StateField<unknown>)[] The dependencies.
get (state: EditorState) => Input The getter function.

Returns: ExtensionThe extension.