state.params is undefined in effects
See original GitHub issueExpected behavior
Effects should have access to the current state.params
. Beyond my use case, I’d expect the state
passed to effects, reducers, and views to be the same.
Actual behavior
The state that’s provided to effects does not include the params
property.
Steps to reproduce behavior
Test case: http://requirebin.com/?gist=b0650339f49b3f08bd49812b938d4a66
Looking at the source, it looks like this may have been a design decision because params
is only created in the context of the router and only passed to the views. So I’ll wait to hear back on whether that was intentional (or if I’m doing it wrong) before digging any deeper.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
$state, $stateParams, getting undefined object - Stack Overflow
So your parameters mismatch and it turns out you will get $state in $stateparms and $state is empty. And $http hold $state :P....
Read more >ngrx/effects - Gitter
hi, I am trying to follow the example at ngrx.io/effects. The example has ``` movies$: Observable<Movie[]> = this.store.select(state => state.movies); ...
Read more >Route Params with NgRx Store | Brian F Love
Application state is persisted into the route. Selectors. NgRx includes selectors to access the current route URL, it's route parameters, query ...
Read more >Managing different slices of the same NgRx state
To come to a solution we'll use the Angular Router, NgRx Effects, ... To parse and read the URL parameters it needs a...
Read more >Actions and reducers: updating state - Human Redux
In Redux all changes to the application state happen via an "action. ... Function params default to undefined if not specified by the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
state.location.params
exists now (:@dmotz
params.state
exists now, and we’ll be adding more info inv4
😄