Meteor Reactive Path
Just a package to parse an URI and make it available as a reactive variable.
Note that this package does not handle changing the browser history or related stuff.
Install
To install into a new project:
> meteor add coderstv:reactive-path
Usage
Set the path
Path.set('/somepath')
to set the path.
Get the path
Path()
to get the current path.
Path(true)
to get the current path without the trailing slash
Examples:
1Path.set('/'); 2Path.get(); // returns / 3Path.get(true); // returns / 4 5Path.set('/test/') 6Path.get(); // returns /test/ 7Path.get(true); // returns /test 8 9Path.set('/test/?param=1') 10Path.get(); // returns /test/ 11Path.get(true); // returns /test 12 13Path.set('/test/#section') 14Path.get(); // returns /test/ 15Path.get(true); // returns /test