Nothing Special   »   [go: up one dir, main page]

0.0.37 • Published 5 years ago

rxjs-first-router v0.0.37

Weekly downloads
4
License
MIT
Repository
github
Last release
5 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

5 years ago

0.0.35

5 years ago

0.0.36

5 years ago

0.0.37

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago