-
Notifications
You must be signed in to change notification settings - Fork 3
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
WIP incremental loading #1
base: new_observablecollection_merge
Are you sure you want to change the base?
Conversation
Looks interesting, but I don't think I fully understand. Is there a sample that demonstrates this new behavior? |
I expect to update some sample tomorrow (one way seq or submodel seq). Now I struggle with the issue dotnet/fsharp#11516 |
@TysonMN, the |
When I try to compile the branch (currently at commit e4df967), there are ~90 compile errors. I was able to avoid them by unloading I was able to run the As for the design, I am a bit put off by the use of Incremental loading is not a top priority for me at the moment, but I don't want to forget about it either, so I just created elmish/Elmish.WPF#384. |
WPF requires GTK to be installed as far as I know |
d51f144
to
e9810db
Compare
@TysonMN how would you recommend covering this new functionality with tests? |
Given my limited knowledge of this feature, I would want to spend more time on the API. I still hope that Is it possible to replace |
e9810db
to
aaad191
Compare
2adf622
to
7348396
Compare
Probably but I don't know how. | LoadMore (count, tcs) ->
let intCount = int count
let builder = m.IncrementalLoadingNumbers.ToBuilder()
let max = FlatList.last m.IncrementalLoadingNumbers
for i = max + 1 to max + intCount do
builder.Add(i)
tcs.SetResult(count)
{ m with IncrementalLoadingNumbers = builder.ToImmutable() } If I replace type Msg =
| LoadMore of count: uint * complete: (uint -> Async<unit>)
| LoadedMore of items: FlatList<int>
let asyncLoadItems (complete: uint -> Async<unit>) (items: FlatList<int>) count = async {
let intCount = int count
let builder = items.ToBuilder()
let max = FlatList.last items
for i = max + 1 to max + intCount do
builder.Add(i)
do! complete count
return LoadedMore <| builder.ToImmutable ()
}
let update msg m =
match msg with
| LoadMore (count, complete) -> m, asyncLoadItems complete m.IncrementalLoadingNumbers count |> Cmd.OfAsync.result
| LoadedMore items -> { m with IncrementalLoadingNumbers = items }, Cmd.none Is it better? |
I think so, but I would need to play with it. I am making steading progress (something nearly every day) on Elmish.WPF, so I hope that v4 is not far off. Then I can focus on other ideas like this one. Keep up the good work! :) |
@TysonMN I've created a new branch with simplification and necessary explanation comments |
(Sorry for the delay) Overall, it looks better. Would it be possible to add incremental loading in a single commit? I think that would make it easier for me to follow the changes. |
738d2d2
to
c89a7bc
Compare
`let`` must not call `this` until type initialized.
c89a7bc
to
25cd527
Compare
…d versions with SolutionTemplate
… ErrorsChanged subscriptions in ViewModel
…r in Shell for all pages except Main
25cd527
to
e5f29a8
Compare
e5f29a8
to
ad1fdd8
Compare
@TysonMN I started the implementation of incremental loading support.
What do you think of naming and API shape?