MCPcopy Create free account
hub / github.com/dailydotdev/apps / onDomMutationGuarded

Function onDomMutationGuarded

packages/shared/src/lib/domMutationGuard.ts:18–29  ·  view source on GitHub ↗
(
  callback: DomMutationGuardListener,
)

Source from the content-addressed store, hash-verified

16};
17
18export const onDomMutationGuarded = (
19 callback: DomMutationGuardListener,
20): (() => void) => {
21 listener = callback;
22 pendingHits.splice(0).forEach((method) => callback(method));
23
24 return () => {
25 if (listener === callback) {
26 listener = undefined;
27 }
28 };
29};
30
31// @see https://github.com/facebook/react/issues/11538#issuecomment-417504600
32export const installDomMutationGuard = (): void => {

Callers 2

useErrorFunction · 0.90

Calls 1

callbackFunction · 0.50

Tested by

no test coverage detected