-
-
Notifications
You must be signed in to change notification settings - Fork 193
SortAndBind fixes and improvements #939
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ae5a789
SortAndBind: Enable opt-in to ResetOnFirstTimeLoad + SortAndBind spec…
RolandPheasant 259fa73
Merge branch 'main' into feature/bring-back-resetonfirsttimeload
dwcullop 8c028a0
Add MainThreadScheduler option to DynamicDataOptions and use this for…
RolandPheasant 9547f08
Add scheduler overloads for SortAndBind and bind which targets virtua…
RolandPheasant 5e5b02e
Add scheduler overloads for SortAndBind and bind which targets page c…
RolandPheasant c2523fe
Merge branch 'main' into feature/bring-back-resetonfirsttimeload
dwcullop bc2810f
Remove IScheduler overload from sort and bind. Instead, add the sched…
RolandPheasant File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is insufficient. Refer to #932, the logical query this needs to serve as a replacement for is...
I.E. the scheduling needs to be applied to both input streams,
sourceandcomparer. Otherwise, notifications coming in oncomparercan trigger theObservableCollectionbe manipulated off of the main thread.Another
.ObserveOn()call applied tocomparershould be sufficient here, since there is no change stream "between" the sorting and binding steps anymore.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair call, I'll fix that.
Also I was wondering whether to add scheduler overloads to SortAndBind, or instead to instruct the use of
which is neat but not obvious.
Or should I do both? Thoughts?
EDIT:
Or better yet set the scheduler like RxUI:
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've applied the scheduler to the comparer changed observable, and moved the UI thread scheduler option to
DynamicDataOptions.MainThreadScheduler.So the one remaining question is whether it's worth adding 12 new overloads to pass an optional comparer to SortAndBind or to rely on the global main thread scheduler only?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say both. There's value in being able to specify on a per-call basis, and in being able to set it globally and not have to worry about it.
Not sure about whether a global-level scheduler should be universal, or per-operator. Again, I think there's value in both, but in this case, I think it's a little cumbersome to HAVE both.
Rather than
MainThreadScheduler, I would suggestBindSchedulerorBindingSchedulerbecause that clarifies how it's actually being USED if you set it. It would only be pulled for binding operations.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to BindingScheduler + added scheduler overloads for new generation of binding operators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest both: Giving the ability to provide all the options for their special cases AND providing a helper method that facilitates the most common use case(s).