AdaptiveStateVariableBinding is used by producers and state accessor functions. There is a bit of confusion what a binding exactly means and what is it supposed to exactly do.
I've removed the fromBinding parameter from AdaptivePropertyProvider.setValue during adat class development, so now
setValue calls the binding that called setValue as well.
override fun setValue(path: Array<String>, value: Any?, fromBinding: AdaptiveStateVariableBinding<*>) {
when {
path[0] == "i" -> values[0] = value
}
bindings.forEach { if (it != fromBinding && it.path.contentEquals(path)) it.setValue(path, false) }
}
I have to decide the pattern/convention for state accessors:
I really want to keep the clean syntax: input { a.b.c }
The use cases might be overwhelmingly copyStore based
That means I don't really need AdaptiveStateVariableBinding.setValue as the change goes through the store anyways. More precisely, I don't have to set the value directly.
The only question is if I want to keep the possibility to directly write back to the state variable. I'm not sure about that.
AdaptiveStateVariableBinding
is used by producers and state accessor functions. There is a bit of confusion what a binding exactly means and what is it supposed to exactly do.I've removed the
fromBinding
parameter fromAdaptivePropertyProvider.setValue
during adat class development, so nowsetValue
calls the binding that called setValue as well.I have to decide the pattern/convention for state accessors:
input { a.b.c }
copyStore
basedThat means I don't really need
AdaptiveStateVariableBinding.setValue
as the change goes through the store anyways. More precisely, I don't have to set the value directly.The only question is if I want to keep the possibility to directly write back to the state variable. I'm not sure about that.