UNPKG

@portabletext/editor

Version:

Portable Text Editor made in React

14 lines (11 loc) 327 B
import type {EditorSelector} from '../editor/editor-selector' import {getActiveStyle} from './selector.get-active-style' /** * @public */ export function isActiveStyle(style: string): EditorSelector<boolean> { return (snapshot) => { const activeStyle = getActiveStyle(snapshot) return activeStyle === style } }