
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
@angular-redux/router
Advanced tools
Bindings to connect @angular/router to @angular-redux/core
npm install @angular-redux/router --save
routerReducer
when providing Store
:import { combineReducers } from 'redux';
import { routerReducer } from '@angular-redux/router';
export default combineReducers<IAppState>({
// your reducers..
router: routerReducer,
});
import { NgModule } from '@angular/core';
import { NgReduxModule, NgRedux } from '@angular-redux/core';
import { NgReduxRouterModule, NgReduxRouter } from '@angular-redux/router';
import { RouterModule } from '@angular/router';
import { routes } from './routes';
@NgModule({
imports: [
RouterModule.forRoot(routes),
NgReduxModule,
NgReduxRouterModule.forRoot(),
// ...your imports
],
// Other stuff..
})
export class AppModule {
constructor(ngRedux: NgRedux<IAppState>, ngReduxRouter: NgReduxRouter) {
ngRedux.configureStore(/* args */);
ngReduxRouter.initialize(/* args */);
}
}
When using a wrapper for your store's state, such as Immutable.js, you will need to change two things from the standard setup:
UPDATE_LOCATION
and return the payload merged into state.selectLocationFromState
option on NgReduxRouter
's initialize()
.These two hooks will allow you to store the state that this library uses in whatever format or wrapper you would like.
Depending on your app's needs. It may need to supply the current URL of the page differently than directly
through the router. This can be achieved by initializing the bindings with a second argument: urlState$
.
The urlState$
argument lets you give NgReduxRouter
an Observable<string>
of the current URL of the page.
If this argument is not given to the bindings, it defaults to subscribing to the @angular/router
's events, and
getting the URL from there.
10.0.0 (2019-05-04)
FAQs
Keep your Angular 2+ router state in Redux.
The npm package @angular-redux/router receives a total of 1,282 weekly downloads. As such, @angular-redux/router popularity was classified as popular.
We found that @angular-redux/router demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.