( callback: DomMutationGuardListener, )
| 16 | }; |
| 17 | |
| 18 | export 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 |
| 32 | export const installDomMutationGuard = (): void => { |
no test coverage detected