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

Function useInstantEffect

src/hooks/useInstantEffect.ts:15–22  ·  view source on GitHub ↗
( fn: VoidFunction, deps: DependencyList )

Source from the content-addressed store, hash-verified

13 * @param deps The dependency list.
14 */
15export const useInstantEffect = ( fn: VoidFunction, deps: DependencyList ): void => {
16 const [ prevDeps, setDeps ] = useState<any>( null );
17
18 if ( !shallowCompareArrays( prevDeps, deps ) ) {
19 fn();
20 setDeps( [ ...deps ] );
21 }
22};

Callers 3

useInstantEditorEffectFunction · 0.85
useAsyncValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…