Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with payload freeze with @ngrx/router-store actions #5

Closed
cmdickson opened this issue Nov 16, 2016 · 2 comments
Closed

Issue with payload freeze with @ngrx/router-store actions #5

cmdickson opened this issue Nov 16, 2016 · 2 comments

Comments

@cmdickson
Copy link

The recent changes to freeze the payload cause an issue when using the @ngrx/router-store library.
A number of the actions made available by that library allow for the NavigationExtras to be included in the action payload. One of those values can be the ActivatedRoute:

constructor(private _route: ActivatedRoute) {}
... 
someFunction(route: string): void {
    this._store.dispatch(go([route], {}, {relativeTo: this._route}));
}

When the go action is processed by the store reducers, the properties of the ActivatedRoute, including Observables etc, get frozen, which causes all sorts of errors later on.

Not sure if this is really an issue with this library, or bad practice to include these sorts of objects in the action payload. Just thought I'd bring it to your attention.

@aegyed91
Copy link
Collaborator

@KwintenP what do you think? @cmdickson is talking about #2

As i stated here I dont use ngrx / redux architecture anymore. I don't have the insight but i want to close this. We need a decision.

@brandonroberts
Copy link
Owner

The ActivatedRoute is a complex object with circular references, so it cannot be frozen. To get around this, you need to exclude these actions from being frozen by this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants