Skip to content
This repository has been archived by the owner on Jan 6, 2018. It is now read-only.

Commit

Permalink
[skip-ci] Update README with API section
Browse files Browse the repository at this point in the history
  • Loading branch information
Vijar committed Jan 27, 2015
1 parent 4817c07 commit e4b7fb7
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,34 @@ var pluginInstance = routrPlugin({

app.plug(pluginInstance);
```
[//]: # (API_START)
## Routr Plugin API

## Fluxible Methods Added
### Instance Methods

### actionContext
#### Constructor(options)

Provides full access to the routr instance. See [routr docs](https://github.com/yahoo/routr) for more information.
Creates a new fetchr plugin instance with the following parameters:

* `actionContext.router.makePath(routeName, routeParams)`: Create a URL based on route name and params
* `actionContext.router.getRoute(path)`: Returns matched route
* `options`: An object containing the plugin settings
* `options.routes` (optional): Stores your routes configuration

## Other Methods
#### getRoutes

The plugin also provides access to some internals and the options that were passed in.
getter for the `routes` option passed into the constructor.

```
pluginInstance.getRoutes(); // returns the full routes object passed to factory
```

### actionContext Methods

Provides full access to the routr instance. See [routr docs](https://github.com/yahoo/routr) for more information.

* `actionContext.router.makePath(routeName, routeParams)`: Create a URL based on route name and params
* `actionContext.router.getRoute(path)`: Returns matched route
[//]: # (API_STOP)

## License

This software is free to use under the Yahoo! Inc. BSD license.
Expand Down

0 comments on commit e4b7fb7

Please sign in to comment.