You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/webui/src/client/lib/ReactMeteorData/ReactMeteorData.tsx
+30Lines changed: 30 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -368,6 +368,36 @@ export function useTracker<T, K extends undefined | T = undefined>(
368
368
returnmeteorData
369
369
}
370
370
371
+
/**
372
+
* A Meteor Tracker hook that allows using React Functional Components and the Hooks API with Meteor Tracker
373
+
*
374
+
* This is an alternate implementation which supports promises in the autorun function, and will preserve the previous value until the promise resolves.
375
+
*
376
+
* @param {() => Promise<T>} autorun The autorun function to be run.
377
+
* @param {React.DependencyList} [deps] A required list of dependenices to limit the tracker re-running. Can be left empty, if tracker
378
+
* has no external dependencies and should only be rerun when it's invalidated.
379
+
* @param {K} [initial] An optional, initial state of the tracker. If not provided, the tracker may return undefined.
0 commit comments