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

can.route.setState doesn't deep clean the route #1420

Closed
imjoshdean opened this Issue Feb 2, 2015 · 0 comments

Comments

Projects
None yet
2 participants
@imjoshdean
Contributor

imjoshdean commented Feb 2, 2015

Right now if we have a route that has a multi-level deep object representation such as:

can.route.attr();
/* 
{
     panelA: {
          name: 'example',
          id: 15,
          show: true
     }
}
*/

If we were to change the route via the hashchange event with a hash representation such as:

{
     panelA: {
          name: 'example',
          id: 20,
          foo: false
     }
}

it would call can.route.setState; however, rather than removing panelA.show and adding panelA.foo we get a hash representation such as:

{
     panelA: {
          name: 'example',
          id: 20,
          show: true,
          foo: false
     }
}

This is a relatively simple fix just by changing setState to recursively clean the object and data rather than just doing it a single level deep as it currently does.

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