Skip to content

Instantly share code, notes, and snippets.

@bendrucker
Last active September 22, 2015 15:14
Show Gist options
  • Select an option

  • Save bendrucker/8aa06e7ac3a613c3da5f to your computer and use it in GitHub Desktop.

Select an option

Save bendrucker/8aa06e7ac3a613c3da5f to your computer and use it in GitHub Desktop.
Playing with routing ideas
Router.hook(route.profile, function (state) {
state.put('profile', Profile())
})
Router.unhook(route.profile, function (state) {
state.delete('profile')
})
Router.hook(route.order, function (state, params, callback) {
var order = Order({id: params.id})
state.put('order', id)
Order.fetch(order, callback)
return Order.poll(order).cancel
})
Router.unhook(route.order, function (state) {
state.delete('order')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment