How to use the riot.route 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 prateekbh / riot-tagrouter / tests / isomorphism.js View on Github external
if (serverSidePath.test(loc)) {
					var matches = loc.match(serverSidePath);
					matches.length && matches.shift();

					routeParams = {};
					params && params.forEach(function (param, index) {
						routeParams[param] = matches[index];
					});

					_isRouteRendedered = true;
					changeRoute(component);
				}
			} else if (typeof window !== 'undefined') {

				riot.route(path, function () {
					var _arguments = arguments;


					routeParams = {};

					params && params.forEach(function (param, index) {
						routeParams[param] = _arguments[index];
					});

					changeRoute(component);
				});

				riot.route.start(true);
			}
		})(path, component);
	};
github andrewdelprete / boilerplates / riotjs-gulp-browserify-es6-boilerplate / src / scripts / app.js View on Github external
function handler(collection, id, action) {

    if (!Riot.mixin('peoplelistObservable')) {
        Riot.mixin('peoplelistObservable', new PeoplelistObservable());
    }

    if (currentPage) {
        currentPage.unmount(true)
    }

    var fn = routes[collection || 'home'];
    return fn ? fn(id, action) : console.error('no route found : ', collection, id, action);
}

Riot.route(handler);
Riot.route.exec(handler);
github danigb / music-scale / browser.js View on Github external
function route (decimal, name) {
    decimal = decimal || ''
    var hash = '' + decimal
    if (name) hash += '/' + name
    riot.route(hash)
  }
github prateekbh / riot-tagrouter / index.js View on Github external
import router from './tags/router.tag';
import route from './tags/route.tag';
import approute from './tags/app-router.tag';
import riot from 'riot';

riot.mount('app-routes');
riot.route('user/profile/prateek1');
window.riot=riot;
github marcbachmann / limelight / client / configuration / index.js View on Github external
this.goto = function (evt) {
    riot.route('plugins/' + evt.item.name)
  }
github marcbachmann / limelight / client / configuration / index.js View on Github external
client.on('dom-ready', function () {
  riot.mount('*')
  riot.route.start()
  riot.route('plugins')
})
github danigb / music-scale / app / router.js View on Github external
function route (decimal, name) {
    decimal = decimal || ''
    var hash = '' + decimal
    if (name) hash += '/' + name
    riot.route(hash)
  }