@district01/ng-redux-router

Sync Angular router state with redux, including: current path, current url, query params, route params, fragment, previous route.

This package has been moved. Use the @studiohyperdrive/ng-redux-router package instead.
Last updated a year ago by tom-odb .
Repository · Original npm · Tarball · package.json
$ cnpm install @district01/ng-redux-router 
SYNC missed versions from official npm registry.

Angular Redux Router

Sync Angular Router state with the Redux app state, gaining easy access to the entire route, not just the activated route.

Dependencies

  • @angular/router

Installation

npm install @district01/ng-redux-router --save

Import component in app.module.ts:

import { ReduxRouterModule } from '@district01/ng-redux-router';

@NgModule({
    imports: [
        ReduxRouterModule
    ]
})

export class AppModule {}

Initialize ReduxRouter with a dispatch function (e.g. using the @angular-redux/store package:

constructor(
    private ngRedux: NgRedux<MyAppState>,
    private reduxRouter: ReduxRouter
) {
    reduxRouter.initialize(ngRedux.dispatch);
}

Usage

The ReduxRouter will listen for route changes and store the current, previous and active (pending) route in the state. The following properties are stored for each route:

  • url: the complete path including queryParams & fragments
  • path: the url path without queryParams & fragments
  • frament: the current active fragment
  • query: all queryParams found on the route
  • params: all route params found on the route

The ROUTE_UPDATE action will only be dispatched once the NavigationEnd event is triggered.

Current Tags

  • 3.1.2                                ...           latest (a year ago)
  • 3.0.0-alpha.9                                ...           next (a year ago)

16 Versions

  • 3.1.2 [deprecated]           ...           a year ago
  • 3.1.1 [deprecated]           ...           a year ago
  • 3.0.0 [deprecated]           ...           a year ago
  • 3.0.0-alpha.9                                ...           a year ago
  • 3.0.0-alpha.8                                ...           a year ago
  • 3.0.0-alpha.5                                ...           a year ago
  • 3.0.0-alpha.4                                ...           a year ago
  • 3.0.0-alpha.3                                ...           a year ago
  • 3.0.0-alpha.2                                ...           a year ago
  • 3.0.0-alpha.1                                ...           a year ago
  • 2.0.7 [deprecated]           ...           a year ago
  • 2.0.6 [deprecated]           ...           a year ago
  • 2.0.5 [deprecated]           ...           a year ago
  • 2.0.4 [deprecated]           ...           2 years ago
  • 2.0.3 [deprecated]           ...           2 years ago
  • 2.0.2 [deprecated]           ...           2 years ago
Downloads
Today 0
This Week 0
This Month 32
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |