We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
data()
1 parent 43828b3 commit 396c600Copy full SHA for 396c600
‎docs/hooks/data.md‎
@@ -9,6 +9,7 @@
9
`.data()` is triggered right after all resources in `.waitOn()` and `.waitOnResources()` hooks are ready. __This hook can be async__
10
11
```js
12
+// USE data() HOOK WITH PUBLISH / SUBSCRIBE
13
FlowRouter.route('/post/:_id', {
14
name: 'post',
15
waitOn(params) {
@@ -18,6 +19,14 @@ FlowRouter.route('/post/:_id', {
18
19
return await PostsCollection.findOneAsync({ _id: params._id });
20
}
21
});
22
+
23
+// USE data() HOOK WITH METEOR METHOD
24
+FlowRouter.route('/post/:_id', {
25
+ name: 'post',
26
+ async data(params, qs) {
27
+ return await Meteor.callAsync('post.get', params._id);
28
+ }
29
+});
30
```
31
32
#### Passing data into a *Template*
0 commit comments