UNPKG

contenido

Version:

Contenido is a library with a set of tools to help you create your own rich text editor on top of draft-js without thinking about how to handle things.

18 lines (13 loc) 508 B
// Custom Utilities import clearBlockTypes from './clearBlockTypes'; import clearEntities from './clearEntities'; import clearInlineStyles from './clearInlineStyles'; // Custom Types import type { State, StateHandler } from '../../types'; const clear = (state: State, stateHandler: StateHandler): State => { const utilities = [clearInlineStyles, clearBlockTypes, clearEntities]; return utilities.reduce((acc, utility) => { return utility(acc, stateHandler); }, state); }; export default clear;