|
|
|
|
|
by AdamCraven
4152 days ago
|
|
What you are linking to is still two-way data binding. Which enforces a one-way flow of data. Two-way binding: Read & Write. Read & Write happens through getter/setter methods. One-way binding: Read only. Writes happen by external event listeners. Both can be used to enforce one way flow of data. Just as one way binding can be used to have a uni-directional flow of data. A pseudo code example with two-way data binding with one-way flow of data: <input type="text" value=getOrSetValue() />
function getOrSetValue(newValue) {
if (newValue) {
// Send an event to a dispatcher with updated value.
} else {
return value // can be single value from model or derived value, such as calculation of multiple values.
}
}
|
|