How to use the boring-router.MemoryHistory function in boring-router

To help you get started, we’ve selected a few boring-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 makeflow / boring-router / packages / boring-router-react / examples / service / main.tsx View on Github external
import {IRouteService, MemoryHistory, RouteMatch, Router} from 'boring-router';
import {observable} from 'mobx';
import {observer} from 'mobx-react';
import React, {Component, ReactNode} from 'react';
import ReactDOM from 'react-dom';

import {Link, Route} from '../../bld/library';

const history = new MemoryHistory();

class Account {
  constructor(readonly id: string) {}

  get avatarURL(): string {
    return `https://gravatar.com/avatar/${this.id}`;
  }
}

const router = new Router(history);

const route = router.$route({
  default: {
    $match: '',
  },
  account: {

boring-router

A type-safe MobX router with parallel routing support.

MIT
Latest version published 1 year ago

Package Health Score

52 / 100
Full package analysis

Similar packages