1.0.0-beta.1 • Published 4 years ago

meiosis-router v1.0.0-beta.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

meiosis-router

Meiosis is a pattern, not a library. Nevertheless, in response to popular demand and for your convenience, here is a module that sets up a router for use with Meiosis.

Principles

  • Store the route in the application state
  • Use the route in the state to determine which page to render, what data to load, etc.
  • Clicking on a link, changing the URL in the location bar, etc. changes the route in the state
  • Changing the route in the state programmatically synchronizes the URL in the location bar.

Installation

Using npm:

npm i meiosis-router

Then you can import it and use it with this code:

import { createRouter } from 'meiosis-router';

const router = createRouter({ ... });

Using a script tag:

<script src="https://unpkg.com/meiosis-router/meiosis-router.js"></script>

Or load the minimized version:

<script src="https://unpkg.com/meiosis-router/meiosis-router.min.js"></script>

Then use the MeiosisRouter global variable:

const router = MeiosisRouter.createRouter({ ... });

Documentation

Please refer to the meiosis-router Documentation.


meiosis-router is developed by foxdonut (@foxdonut00) and is released under the MIT license.

1.1.0

3 years ago

1.0.0

3 years ago

1.0.0-beta.10

3 years ago

1.0.0-beta.8

3 years ago

1.0.0-beta.9

3 years ago

1.0.0-beta.7

4 years ago

1.0.0-beta.5

4 years ago

1.0.0-beta.4

4 years ago

1.0.0-beta.3

4 years ago

1.0.0-beta.2

4 years ago

1.0.0-beta.1

4 years ago