1.20.4 • Published 7 years ago

slex-router v1.20.4

Weekly downloads
23
License
MIT
Repository
github
Last release
7 years ago

CircleCI

Slex Router

$ npm install slex-router

slex-router is a simple client side router which exposes an rxjs stream.

Example Usage

import slexRouter from 'slex-router'

const routes = {
  '/': {
    name: 'home',
    ...anything
  },
  '/item/:id': {
    name: 'itemDetails',
    ...anything
  },
  '/item/:id/child/:childId': {
    name: 'itemDetailsDeep',
    ...anything
  },
  '/*params': {
    name: 'wildcardRoute',
    ...anything
  }
  'default': {
    name: 'defaultRoute',
    ...anything
  }
}

const router = slexRouter
  .createStream(routes)

const subscription = router.subscribe(nextRoute => {
  const { route, routeState } = nextRoute
  const { name, ...anything } = route
  const { id, childId } = routeState
})

subscription.dispose()
1.20.4

7 years ago

1.20.3

7 years ago

1.20.2

7 years ago

1.20.1

7 years ago

1.10.8

7 years ago

1.10.7

7 years ago

1.10.6

7 years ago

1.10.5

7 years ago

1.10.4

7 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago