Skip to content
tmeasday edited this page Apr 1, 2013 · 2 revisions

Meteor.Location

This is (has to be) a singleton that is basically a reactive wrapper around window.location:

// reactive getters that mirror window.location
Meteor.Location.href();
Meteor.Location.hash();
// .. etc

// setters that actual change the URL in a sensible way
Meteor.Location.setHref(href, options);

// where options are things like replace, etc

Obviously it's more than just a wrapper as it has to handle things like pushState, window.onPopState, etc.

Meteor.RouteSet

A side-effect free reactive library that matches URLs to RouteMatches, mediated via Routes.

Potentially this library includes another object (maybe called a Meteor.RouteController) which sets a RouteSet to run a function everytime a specific route matches. Although this is fairly trivial with autorun.

Meteor.Router

A simple API (perhaps exactly like v3) which:

  1. Creates a RouteSet
  2. Wires it up to listen to Meteor.Location
  3. Listens to the RouteSet and sets templates / etc based off it.
Clone this wiki locally