How to use the fluxible-router.RouteStore.withStaticRoutes function in fluxible-router

To help you get started, we’ve selected a few fluxible-router examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jeffhandley / strickland / test / fluxible-example / app.js View on Github external
import Fluxible from 'fluxible';
import { RouteStore } from 'fluxible-router';
import Application from './components/Application';
import routes from './configs/routes';
import ApplicationStore from './stores/ApplicationStore';

// create new fluxible instance
const app = new Fluxible({
    component: Application
});

app.plug(require('../../src/strickland-plugin'));

// register routes
var MyRouteStore = RouteStore.withStaticRoutes(routes);
app.registerStore(MyRouteStore);

// register other stores
app.registerStore(ApplicationStore);

module.exports = app;
github gpbl / isomorphic500 / src / app.js View on Github external
import Root from "./containers/Root";

import FeaturedStore from "./stores/FeaturedStore";
import HtmlHeadStore from "./stores/HtmlHeadStore";
import IntlStore from "./stores/IntlStore";
import PhotoStore from "./stores/PhotoStore";

// Create the fluxible app using Root as root component
const app = new Fluxible({ component: Root });

// Make fetchr services respond to /api endpoint
app.plug(fetchrPlugin({ xhrPath: "/api" }));

// Register a fluxible RouteStore
const AppRouteStore = RouteStore.withStaticRoutes(routes);
app.registerStore(AppRouteStore);

// Register app-specific stores
app.registerStore(FeaturedStore);
app.registerStore(HtmlHeadStore);
app.registerStore(IntlStore);
app.registerStore(PhotoStore);

export default app;
github yahoo / fluxible / site / app.js View on Github external
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
 */

import debugLib from 'debug';
import Fluxible from 'fluxible';
import fetchrPlugin from 'fluxible-plugin-fetchr';
import devToolsPlugin from 'fluxible-plugin-devtools';
import queryPlugin from './plugins/queryPlugin';
import routes from './configs/routes';
import Application from './components/Application';
import DocStore from './stores/DocStore';
import SearchStore from './stores/SearchStore';
import { RouteStore } from 'fluxible-router';

const debug = debugLib('app.js');
const MyRouteStore = RouteStore.withStaticRoutes(routes);

const app = new Fluxible({
    component: Application,
    componentActionHandler: function (context, payload, done) {
        if (payload.err) {
            if (payload.err.statusCode === 404) {
                debug('component 404 error', payload.err);
            }
            else {
                debug('component exception', payload.err);
            }

            return;
        }

        done();