How to use the riot.router function in riot

To help you get started, we’ve selected a few riot 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 gabrielmoreira / riot-router / examples / redux / src / app.js View on Github external
// install router state
import './utils/router.state.js';

// app routes
import {Route, DefaultRoute, NotFoundRoute, RedirectRoute} from 'riot-router/lib/router.js';

riot.router.routes([
  new Route({path: 'user/:id', tag: 'user'}),
  new DefaultRoute({tag: 'users'}),
]);

// Mount all Riot tags.
riot.mount('*');

// Start routing
riot.router.start();

// Exports
window.store = store;
window.riot = riot;
github gabrielmoreira / riot-router / examples / redux / src / app.js View on Github external
import * as store from './stores';
import riot from 'riot';

// install mixins & tags
import './mixins';
import './tags';

// install router state
import './utils/router.state.js';

// app routes
import {Route, DefaultRoute, NotFoundRoute, RedirectRoute} from 'riot-router/lib/router.js';

riot.router.routes([
  new Route({path: 'user/:id', tag: 'user'}),
  new DefaultRoute({tag: 'users'}),
]);

// Mount all Riot tags.
riot.mount('*');

// Start routing
riot.router.start();

// Exports
window.store = store;
window.riot = riot;
github gabrielmoreira / riot-router / test / helper.js View on Github external
if (route && route[0])
      _route.apply(null, _parser(route));
    else
      _route = route;
  }
  riot.route.start = function() {};
  riot.route.exec = function(_route) {};
  exports.riot = riot;
  
})(global);

require('../lib/router.js');

module.exports = {
  riot: riot,
  router: riot.router,
}