Skip to content

Internal state of object changes when running planner #129

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

Open
mielvds opened this issue Sep 24, 2019 · 0 comments
Open

Internal state of object changes when running planner #129

mielvds opened this issue Sep 24, 2019 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@mielvds
Copy link

mielvds commented Sep 24, 2019

When calling the planner as follows:

let from = { latitude: 51.054556,
  longitude: 3.725333,
  name: 'A' };
let to = { latitude: 51.04892,
  longitude: 3.728874,
  name: 'B' };
planner.query({
    from, to
  })
    .take(3)
    .on('end', () => {
      console.log(from)
    });

the id attribute of fromand to will be changed to for example "Departure Point" which is undesireable behavior and will cause problems when using const. Better to make a copy of these ILocation objects in the planner.

@hdelva hdelva self-assigned this Sep 26, 2019
@hdelva hdelva added the bug Something isn't working label Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants