-
-
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
Binding API with composable effects #263
Comments
#295 is essentially a duplicate. It started off as a place to share example uses of |
I updated the initial comment in this issue. I think it is now rather accurate. |
I don't recall the details anymore. Unfortunately I haven't thought about them in years. When I last used the binding API, I thought it was very good. My best guess is that the above list is up to date. |
I would like the binding API include composable effects like
oneWayLazy
,oneWayOptLazy
, andoneWaySeqLazy
when being updated) (c.f. Lazy subModelSeq (and subModel)? #143)oneWayLazy
,oneWayOptLazy
, andsubModelSelectedItem
are memoized/cached when being read by WPF) (c.f. Lazy subModelSeq (and subModel)? #143)twoWayValidate
andtwoWayOptValidate
)SubModel
: i.e. without model or message mapping or option matchingSubModelSelectedItem
to binding APISubModelSelectedItem
binding by using lazy effectoneWayOpt
,oneWayOptLazy
,twoWayOpt
,twoWayOptValidate
(This was actually easy. The optionality is "just" option-aware boxing.)subModelOpt
(This optionality is not the same as the other optionality.)AddId
as a binding effectSeq
/Sequence
into a binding effect by exposingBindingData
Seq
/Sequence
merge based on presence or absence of Id effectoneWaySeq
andSubModelSeq
)get
andset
respectivelyRelated
Excluding those effects, the base binding types would be
oneWay
twoWay
cmd
(with variantscmd
,cmdIf
,cmdParam
, andcmdParamIf
for a total of ten combined overloads)subModel
(with three overloads)subModelWin
(with six overloads)subModelSelectedItem
(with two overloads)(All of those sections of code refer to method names on the
Binding
class.)Maybe more effects could be extracted and duplication removed, but it is hard for me to see that far into the future given the current lack of composable effects and duplication.
This issue will exist for a long time before being resolved. It is not easy to solve. For me personally, I don't know how to achieve all this right now. However, I do think I know how to make progress.
We can make incremental progress on this issue by making internal changes. A good example of this is when caching was added in PR #183. In that case, caching was only added as a case of
VmBinding<'model, 'msg>
and not also as a case ofBindingData<'model, 'msg>
. This feature can probably be extended to a case ofBindingData<'model, 'msg>
. At the same time, we can choose to keep the public API unchanged. In this way, we could create the new API internally and decide when we are ready to publicly expose parts of it or "all" of it.The text was updated successfully, but these errors were encountered: