Small cleanups for IntersectionObserver (#38099)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38099

A couple of small cleanups after the bulk of the work for `IntersectionObserver` was already merged.

Changelog: [internal]

Reviewed By: NickGerleman

Differential Revision: D47056943

fbshipit-source-id: 2a6f9062d91da458f8b980f3abcdc9a4ac86389b
This commit is contained in:
Rubén Norte
2023-07-03 15:34:34 -07:00
committed by Facebook GitHub Bot
parent 2910f87b58
commit 2ccde4060e
@@ -97,8 +97,12 @@ const NativeIntersectionObserverMock = {
);
observations.splice(observationIndex, 1);
},
connect: (notifyIntersectionObserversCallback?: () => void): void => {
connect: (notifyIntersectionObserversCallback: () => void): void => {
invariant(callback == null, 'unexpected call to connect');
invariant(
notifyIntersectionObserversCallback != null,
'unexpected null notify intersection observers callback',
);
callback = notifyIntersectionObserversCallback;
},
disconnect: (): void => {