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
A set of hooks for using Meteor's Mini Mongo Collections and pub/sub.
9
+
10
+
There are two hooks
11
+
12
+
| Hook | Function
13
+
| ---- | --------
14
+
| useSubscription | Used to set up a Meteor subscription. In SSR, this hook is responsible for capturing data to be sent to the client for hydration.
15
+
| useCursor | Manages the lifecycle of a Mongo Cursor
16
+
17
+
Both methods accept a factory method, and deps.
18
+
19
+
## useSubscription(factory, deps)
20
+
21
+
`useSubscription` takes a factory method, which should return a subscription handle, and a deps array. It can also return `void` to conditionally set up no subscription. The hook returns a subscription handle with a reactive `ready` method.
22
+
23
+
Invoking the `ready()` handle method will cause the hook to update react when the subscription becomes available.
0 commit comments