@atlaskit/editor-plugin-metrics
Version:
Metrics plugin for @atlaskit/editor-core
17 lines • 337 B
JavaScript
import { ActionType } from '../types';
export const checkDeletingContent = step => {
const {
slice: {
content
},
from,
to
} = step;
const isDeletingContent = to !== from && content.childCount === 0;
if (!isDeletingContent) {
return undefined;
}
return {
type: ActionType.DELETING_CONTENT
};
};