Recipes
Short code snippets teaching you how to do various things in Vulcan.
Using Router Hooks
The router exposes an onUpdate
hook that triggers every time the route changes (including when the initial route is triggered).
Here’s how you’d use it in conjunction with Apollo’s imperative API to check if the current user has completed their profile:
1 | import { addCallback, getFragment } from 'meteor/vulcan:core'; |
Load a Random Post
On the server:
1 | const randomResolver = { |
On the client:
1 | const withRandomPost = graphql(gql` |