-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Extract a ViewModelHelper that will be useful with static view models #523
Extract a ViewModelHelper that will be useful with static view models #523
Conversation
The diff has huge blocks of + and -, which is very difficult to review on my phone. Is it possible to extract smaller pieces in separate PRs? |
f6befc9
to
17ae441
Compare
@TysonMN can you view the diffs one commit at a time? A lot of these changes don't make much sense on their own. |
Also the majority of the diff issue happens when I split the class in two at the end, and I don't think I can help that because the diff view doesn't track code reordering (which must be done at that time and can't be reduced any more that I can see). |
This comment was marked as outdated.
This comment was marked as outdated.
e6e355a
to
5743879
Compare
5743879
to
1e1cfea
Compare
1e1cfea
to
77fdba1
Compare
77fdba1
to
b224d3e
Compare
b224d3e
to
bd7fd0b
Compare
bd7fd0b
to
bab8b19
Compare
bab8b19
to
73456a3
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
73456a3
to
e20870b
Compare
This comment was marked as outdated.
This comment was marked as outdated.
e20870b
to
1e41dff
Compare
1e41dff
to
52a8dab
Compare
52a8dab
to
ac93865
Compare
@@ -34,6 +34,75 @@ module internal IViewModel = | |||
let currentModel (vm: #IViewModel<'model, 'msg>) = vm.CurrentModel | |||
let updateModel (vm: #IViewModel<'model, 'msg>, m: 'model) = vm.UpdateModel(m) | |||
|
|||
type internal ViewModelHelper<'model, 'msg> = |
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.
Would a better name be ViewModelState
?
|
||
let mutable helper = | ||
ViewModelHelper.create | ||
(fun () -> this) |
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.
Why is this a function?
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 think it was originally to avoid using references to this
in the initialization section, but I'm not sure anymore.
Should rebase easily after #535This should be a behavior-preserving transform that extracts some behavior from
DynamicViewModel
into aViewModelHelper
which can then be shared with a futureViewModelBase
implemented in #522