0.0.37 • Published 4 years ago

rxjs-first-router v0.0.37

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

rxjs-first-router

A simpler, mockable take on redux-first-router using reactive streams

Interfaces

InterfaceUsage
RouterAn Object containing a Navigator, an Observable<string> that pushes out new routes as they occur, and a function to push the current route through the observable
NavigatorAn object with different methods to change the current route. Based on history's navigation interface
export interface Router {
  route$: r.Observable<string>;
  navigator: Navigator;
  pushCurrentRoute: () => void;
}

export interface Navigator {
  push: (path: string) => void;
  replace: (path: string) => void;
  go: (n: number) => void;
  goBack: () => void;
  goForward: () => void;
}

Functions

NameUsage
createRouterCreates a router connected to the browser through history.createBrowserHistory()
createMockRouterCreates a mock router that directly pushes routes from its Navigator to its route$
export const createRouter: () => Router
export const createMockRouter: () => Router
0.0.33

4 years ago

0.0.35

4 years ago

0.0.36

4 years ago

0.0.37

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago