From 6e0bb8ed6b2c588009eaca7f9d41e2a7b46503f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20N=C3=A9vola?= Date: Wed, 31 Jan 2024 08:55:14 -0300 Subject: [PATCH] updates findAsync to fetchAsync on Tracker's docs --- docs/source/api/tracker.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/api/tracker.md b/docs/source/api/tracker.md index c23fed63e1..8701a3d466 100644 --- a/docs/source/api/tracker.md +++ b/docs/source/api/tracker.md @@ -90,13 +90,13 @@ Tracker.autorun(async function example1(computation) { // Code before the first await will stay reactive. reactiveVar1.get(); // This will trigger a rerun. - let links = await LinksCollection.findAsync({}).fetch(); // First async call will stay reactive. + let links = await LinksCollection.find({}).fetchAsync(); // First async call will stay reactive. // Code after the first await looses Tracker.currentComputation: no reactivity. reactiveVar2.get(); // This won't trigger a rerun. // You can bring back reactivity with the Tracker.withCompuation wrapper: - let users = await Tracker.withComputation(computation, () => Meteor.users.findAsync({}).fetch()); + let users = await Tracker.withComputation(computation, () => Meteor.users.find({}).fetchAsync()); // Code below will again not be reactive, so you will need another Tracker.withComputation. const value = Tracker.withComputation(computation, () => reactiveVar3.get()); // This will trigger a rerun.