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

set.toPathValues should dedupe #71

Closed
ThePrimeagen opened this issue Apr 9, 2015 · 6 comments · Fixed by #201
Closed

set.toPathValues should dedupe #71

ThePrimeagen opened this issue Apr 9, 2015 · 6 comments · Fixed by #201
Assignees
Milestone

Comments

@ThePrimeagen
Copy link
Contributor

After talking through how set.toPathValues.progressively should work with @jhusain we realized that core.set should dedupe values. When the first set happens, with an onNext function provided, the core should call onNext every value it finds. If the model has _dedupePathValues flag set, the onNext function should only onNext if the value coming in from set is different that the value in the cache.

@trxcllnt does that sound reasonable?

@ThePrimeagen ThePrimeagen added this to the Open Source milestone Apr 9, 2015
@trxcllnt
Copy link
Contributor

@michaelbpaulson @jhusain do you anticipate this has an impact on the set*asPathValues methods? If so, how should we compare leaves wrt to metadata and values? I remember we toyed around with this idea earlier on and decided against, because it's difficult to meaningfully diff unknown datasets without exposing a comparator (which I'm not necessarily against).

@jhusain
Copy link
Contributor

jhusain commented Apr 10, 2015

A comparator make sense to me. Otherwise we can use ===.

JH

On Apr 9, 2015, at 7:28 PM, Paul Taylor notifications@github.com wrote:

@michaelbpaulson @jhusain do you anticipate this has an impact on the set*asPathValues methods? If so, how should we compare leaves wrt to metadata and values? I remember we toyed around with this idea earlier on and decided against, because it's difficult to meaningfully diff unknown datasets without exposing a comparator (which I'm not necessarily against).


Reply to this email directly or view it on GitHub.

@ktrott
Copy link
Contributor

ktrott commented Apr 20, 2015

Falcor meeting:

@michaelbpaulson : In set toPathValues just doesn't make sense. get double everything you do.

@trxcllnt : set the things in the cache locally, do the network request and onNext what the network request returns

@michaelbpaulson : I want the set to occur immediately on the client. But weird to be onNexted twice when the server response comes back.

Needs more discussion as everyone seems a bit confused on how things are supposed to work.

@jhusain
Copy link
Contributor

jhusain commented Apr 20, 2015

The right answer here is to dedupe values. Only onNext when value changes after server response comes back. For custom comparison we can use the compared API introduced for the observe method.

@ktrott
Copy link
Contributor

ktrott commented Apr 27, 2015

We would use the same comparer function being added for #91

@ktrott
Copy link
Contributor

ktrott commented May 4, 2015

Related to issue #170

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

Successfully merging a pull request may close this issue.

4 participants