Skip to content

Commit

Permalink
Finalized the Observe API, optimzied the code, and ensuring hooks and…
Browse files Browse the repository at this point in the history
… observers are called in the order in which they were added.
  • Loading branch information
Jacob Wright committed Mar 1, 2010
1 parent 1e5baf5 commit ee1491c
Show file tree
Hide file tree
Showing 3 changed files with 427 additions and 142 deletions.
Binary file modified project/bin/flight-framework.swc
Binary file not shown.
21 changes: 10 additions & 11 deletions project/src/flexUnitTests/binding/ObservingBindTest.as
Expand Up @@ -238,9 +238,8 @@ internal class TestObject

public function set obj(value:TestObject):void
{
if (_obj == value || !Observe.canChange(this, "obj", _obj, value)) return;
value = Observe.modifyChange(this, "obj", _obj, value);
Observe.notifyChange(this, "obj", _obj, _obj = value);
_obj = Observe.change(this, "obj", _obj, value);
Observe.notify();
}

[Bindable(observable)]
Expand All @@ -251,8 +250,8 @@ internal class TestObject

public function set bool(value:Boolean):void
{
if (_bool == value) return;
Observe.notifyChange(this, "bool", _bool, _bool = value);
_bool = Observe.change(this, "bool", _bool, value);
Observe.notify();
}

[Bindable(observable)]
Expand All @@ -263,8 +262,8 @@ internal class TestObject

public function set num(value:Number):void
{
if (_num == value) return;
Observe.notifyChange(this, "num", _num, _num = value);
_num = Observe.change(this, "num", _num, value);
Observe.notify();
}

[Bindable(observable)]
Expand All @@ -275,8 +274,8 @@ internal class TestObject

public function set str(value:String):void
{
if (_str == value) return;
Observe.notifyChange(this, "str", _str, _str = value);
_str = Observe.change(this, "str", _str, value);
Observe.notify();
}

[Bindable(observable)]
Expand All @@ -287,8 +286,8 @@ internal class TestObject

public function set custom(value:String):void
{
if (_custom == value) return;
Observe.notifyChange(this, "custom", _custom, _custom = value);
_custom = Observe.change(this, "custom", _custom, value);
Observe.notify();
}

public function clone():TestObject
Expand Down

0 comments on commit ee1491c

Please sign in to comment.