Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update docs and rename project to can-observation
This renames the project to can-observation. Part of #4
- Loading branch information
Showing
13 changed files
with
342 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,5 +27,5 @@ node_modules | |
# Users Environment Variables | ||
.lock-wscript | ||
|
||
docs/ | ||
doc/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
require("./reader/reader_test"); | ||
|
||
var Observation = require('can-observation'); | ||
var QUnit = require('steal-qunit'); | ||
var CID = require('can-util/js/cid/cid'); | ||
|
||
var assign = require("can-util/js/assign/assign"); | ||
var canEvent = require('can-event'); | ||
|
||
QUnit.module('can-observation'); | ||
|
||
QUnit.test('nested traps are reset onto parent traps', function() { | ||
var obs1 = assign({}, canEvent); | ||
CID(obs1); | ||
var obs2 = assign({}, canEvent); | ||
CID(obs2); | ||
|
||
var oi = new Observation(function() { | ||
|
||
var getObserves1 = Observation.trap(); | ||
|
||
Observation.add(obs1, "prop1"); | ||
|
||
var getObserves2 = Observation.trap(); | ||
Observation.add(obs2, "prop2"); | ||
|
||
var observes2 = getObserves2(); | ||
|
||
Observation.addAll(observes2); | ||
|
||
var observes1 = getObserves1(); | ||
|
||
equal(observes1.length, 2, "two items"); | ||
equal(observes1[0].obj, obs1); | ||
equal(observes1[1].obj, obs2); | ||
}, null, function() { | ||
|
||
}); | ||
|
||
oi.getValueAndBind(); | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.