Skip to content

Commit

Permalink
Clear setImmediateId + add runtime types for setImmediate function
Browse files Browse the repository at this point in the history
  • Loading branch information
bimusiek committed Jun 17, 2024
1 parent 9177da6 commit 4b49d74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/realm-react/src/cachedCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ export function createCachedCollection<T extends Realm.Object<any>>({
if (!isDerived) {
if (setImmediateId) {
clearImmediate(setImmediateId);
setImmediateId = undefined;
}
collection.removeListener(listenerCallback);
objectCache.clear();
Expand Down
3 changes: 3 additions & 0 deletions packages/realm-react/src/runtime.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ declare type Console = {
declare const console: Console;

declare function setImmediate(cb: (...args: unknown[]) => void);

declare type Timer = unknown;
declare function clearImmediate(timer: Timer): void;

0 comments on commit 4b49d74

Please sign in to comment.