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

New deref from an already deref'd model doesn't include the parent model's path. #560

Closed
trxcllnt opened this issue Sep 28, 2015 · 0 comments

Comments

@trxcllnt
Copy link
Contributor

@michaelbpaulson @sdesai @jhusain I don't have time to submit a PR right this second, but this line needs to be:

    _path: this._path.concat(nextPath)

This comes up if you do:

root.get('key1.key2.leafValue')
  .flatMap(({json}) => {
    var model1 = root.deref(json.key1);
    return model1.get('key2.leafValue').map(({json} => model1.deref(json.key2))
  })
  .subscribe((model2) => {
    console.log(model2._path); // will be ['key2'] instead of ['key1', 'key2']
  });

Obviously contrived example, but you get the point. Since the second get's JSON is relative to "key1", calling deref with the result of the second get doesn't include key1 like it should.

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

No branches or pull requests

2 participants