1234567891011121314151617181920212223242526 |
- describe("S.freeze", function () {
- it("batches changes until end", function () {
- var d = S.data(1);
-
- S.freeze(function () {
- d(2);
- expect(d()).toBe(1);
- });
-
- expect(d()).toBe(2);
- });
-
- it("halts propagation within its scope", function () {
- S.root(function () {
- var d = S.data(1),
- f = S(function() { return d(); });
-
- S.freeze(function () {
- d(2);
- expect(f()).toBe(1);
- });
-
- expect(f()).toBe(2);
- });
- });
- });
|