MCPcopy Create free account
hub / github.com/ckeditor/ckeditor5-react / useInstantEditorEffect

Function useInstantEditorEffect

src/hooks/useInstantEditorEffect.ts:14–24  ·  view source on GitHub ↗
(
	semaphore: Pick<LifeCycleElementSemaphore<R>, 'runAfterMount'> | null,
	fn: ( mountResult: R ) => void,
	deps: DependencyList
)

Source from the content-addressed store, hash-verified

12 * `useEffect` alternative but executed after mounting of editor.
13 */
14export const useInstantEditorEffect = <R>(
15 semaphore: Pick<LifeCycleElementSemaphore<R>, 'runAfterMount'> | null,
16 fn: ( mountResult: R ) => void,
17 deps: DependencyList
18): void => {
19 useInstantEffect( () => {
20 if ( semaphore ) {
21 semaphore.runAfterMount( fn );
22 }
23 }, [ semaphore, ...deps ] );
24};

Callers 2

useMultiRootEditorFunction · 0.85

Calls 2

useInstantEffectFunction · 0.85
runAfterMountMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…