You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
fix(compiler): OneWayOneTime bindings now wait for the model to stablize
BREAKING CHANGE
Previously, OneWayOneTime bindings would remove their watch after the
first value assignment. For models that take more than one digest loop
to stablize, this meant the OneWayOneTime bindings took a un-stablized
value.
With this change, these bindings will continue to accept value
assignments until their stablized value is non-null. The assignment may
occur multiple times.
We expect that most uses of OneWayOneTime will be 'ok' with
being called a few times as the model stablizes.
However, applications which depend on OneWayOneTime bindings being
called exactly once will break. The suggested upgrade path is to
move the senstive code into a domWrite callback. e.g. the old code:
@decorator(
map: const { 'one-time': '=>!value' })
class OneTime {
set value(v) => onlyCalledOnce(v);
}
becomes
@decorator(
map: const { 'one-time': '=>!value' })
class OneTime {
var _value;
set value(v) {
if (_value == null) {
scope.rootScope.domWrite(() => onlyCalledOnce(_value));
}
_value = v;
}
}
Closes#1013
0 commit comments