Files
lexical/packages/outline-react/src/OutlineHistory.js
Dominic Gannaway 0174151fee Optimize outline-react bundles (#214)
* Optimize outline-react bundles

* Format file
2022-04-09 00:42:14 -07:00

25 lines
654 B
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
*/
import type {ViewModel, OutlineEditor, View} from 'outline';
export const viewModelsWithoutHistory: Set<ViewModel> = new Set();
export function updateWithoutHistory(
editor: OutlineEditor,
updateFn: (view: View) => void,
): boolean {
const res = editor.update(updateFn);
const pendingViewModel = editor._pendingViewModel;
if (pendingViewModel !== null) {
viewModelsWithoutHistory.add(pendingViewModel);
}
return res;
}