10 lines
638 B
JavaScript
10 lines
638 B
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
*/
|
|
|
|
import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{createEmptyHistoryState as o,registerHistory as r}from"@lexical/history";export{createEmptyHistoryState}from"@lexical/history";import{useMemo as e,useEffect as i}from"react";function a({delay:a,externalHistoryState:c}){const[l]=t();return function(t,a,c=1e3){const l=e((()=>a||o()),[a]);i((()=>r(t,l,c)),[c,t,l])}(l,c,a),null}export{a as HistoryPlugin};
|