Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Home

carlmw edited this page · 15 revisions
Clone this wiki locally

API Reference

$frn

$frn( path, fn )
Add a function to the chain. This will be executed if the path string partially or completely matches the remaining location.
$frn( RegExp, fn )
Add a function to the chain. This will be executed if the RegExp partially or completely matches the remaining location.
$frn( PathArray, fn )
Add several functions to the chain.
.location( path )
Set the path to use for matching.
.location( )
Get the remaining unmatched path.
.data( mixed )
Store some data to be made available inside all actions.
.data( )
Retrieve previously set data.
.queue([String])
Start queueing functions. Pass an optional string identifier to create a custom queue.
.done()
Stop queueing.
.clear([String])
Clear all chained functions from the queue. Pass a string to clear a custom queue.
.dispatch([String])
Dispatch the queue. Pass a string to dispatch a custom queue.

Example usage:

$frn('/videos', function(){
  $frn('/view /edit', function(data){
    alert(data.title);
  });
})
.queue('Special')
  .add('/', function(){
    alert('See this when dispatching a custom queue; perhaps in response to an XHR.'); 
  })
  .done();

PathArray

A nested array literal
[
[‘path’, function(){}],
[/path/, function(){}]
];
Something went wrong with that request. Please try again.