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:

ParameterTypeDescription
depsreadonly ("doc" | "selection" | FacetReader<unknown> | StateField<unknown>)[]The dependencies.
get(state: EditorState) => InputThe getter function.

Returns: ExtensionThe extension.