-
Notifications
You must be signed in to change notification settings - Fork 76
Split API
tmeasday edited this page Apr 1, 2013
·
2 revisions
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.
A side-effect free reactive library that matches URLs to RouteMatch
es, mediated via Route
s.
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
.
A simple API (perhaps exactly like v3) which:
- Creates a
RouteSet
- Wires it up to listen to
Meteor.Location
- Listens to the RouteSet and sets templates / etc based off it.