question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

state.params is undefined in effects

See original GitHub issue

Expected 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:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
yoshuawuytscommented, Jan 7, 2017

state.location.params exists now (:

1reaction
yoshuawuytscommented, Oct 5, 2016

@dmotz params.state exists now, and we’ll be adding more info in v4 😄

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found