From 8ea36eae8b42e5f5eaccc8d60cc9ce5888b62727 Mon Sep 17 00:00:00 2001 From: Gabriel Grubba Date: Mon, 3 Feb 2025 09:54:34 -0300 Subject: [PATCH] DOCS: Fix typo in Tracker.md Before it was using `findAsync({}).fetch` but it should have been `find({}).fetchAsync()` --- v3-docs/docs/api/Tracker.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v3-docs/docs/api/Tracker.md b/v3-docs/docs/api/Tracker.md index b5242b548d5..acbe6ad2548 100644 --- a/v3-docs/docs/api/Tracker.md +++ b/v3-docs/docs/api/Tracker.md @@ -87,13 +87,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.