This package has been deprecated

Author message:

fluxible-plugin-routr is deprecated in favor of fluxible-router

fluxible-plugin-routr

0.3.0 • Public • Published

Routr Plugin for Fluxible App

npm version Build Status Dependency Status devDependency Status Coverage Status

Provides routing methods to your Fluxible application using routr.

Usage

var FluxibleApp = require('fluxible-app');
var routrPlugin = require('fluxible-plugin-routr');
var app = new FluxibleApp();
 
var pluginInstance = routrPlugin({
    routes: {
        user: {
            path: '/user/:id',
            method: 'get',
            // flux-router-component uses this action when the route is matched
            action: function (actionContext, payload, done) {
                // ...
                done();
            }
        }
    }
});
 
app.plug(pluginInstance);

Fluxible Methods Added

actionContext

Provides full access to the routr instance. See routr docs for more information.

  • actionContext.routr.makePath(routeName, routeParams): Create a URL based on route name and params
  • actionContext.routr.getRoute(path): Returns matched route

Other Methods

The plugin also provides access to some internals and the options that were passed in.

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

License

This software is free to use under the Yahoo! Inc. BSD license. See the LICENSE file for license text and copyright information.

/fluxible-plugin-routr/

    Package Sidebar

    Install

    npm i fluxible-plugin-routr

    Weekly Downloads

    1

    Version

    0.3.0

    License

    none

    Last publish

    Collaborators

    • mridgway
    • redonkulus
    • vijar
    • lingyan