Skip to content

Commit e953a7e

Browse files
committed
Removed addComputed
1 parent 4b4aba9 commit e953a7e

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dop",
3-
"version": "0.22.7",
3+
"version": "0.22.8",
44
"main": "./dist/dop.nodejs.js",
55
"browser": "./dist/dop.js",
66
"unpkg": "./dist/dop.min.js",

src/api/addComputed.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

test/computeds.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ test('addComputed', function(t) {
6565
surname:"Gonzalez",
6666
fullname: "..."
6767
})
68-
dop.addComputed(object, 'fullname', function(oldvalue){
68+
dop.set(object, 'fullname', dop.computed(function(oldvalue){
6969
t.equal(oldvalue, "...")
7070
runs += 1
7171
return get(this,"name") +' '+ get(this,"surname")
72-
})
72+
}))
7373

7474
t.equal(object.fullname, "Josema Gonzalez")
7575
t.equal(object.fullname, "Josema Gonzalez")
@@ -261,10 +261,10 @@ test('Deep computed addComputed', function(t) {
261261
surname:"Gonzalez",
262262
subobject: {}
263263
})
264-
dop.addComputed(object.subobject, 'fullname', function(oldvalue){
264+
dop.set(object.subobject, 'fullname', dop.computed(function(oldvalue){
265265
t.equal(oldvalue, undefined)
266266
return get(object,"name") +' '+ get(object,"surname")
267-
})
267+
}))
268268

269269
t.equal(object.subobject.fullname, "Josema Gonzalez")
270270
t.equal(collector.mutations.length, 1, "mutations")
@@ -521,9 +521,9 @@ test('Multiple computed same property', function(t) {
521521
t.equal(object.fullname, "Josema Gonzalez")
522522
set(object, 'name', 'Enzo')
523523
t.equal(object.fullname, "Enzo Gonzalez")
524-
dop.addComputed(object, 'fullname', function(){
524+
dop.set(object, 'fullname', dop.computed(function(){
525525
return (get(this, "name")).toUpperCase()
526-
})
526+
}))
527527
set(object, 'name', 'Enza')
528528
t.equal(object.fullname, "ENZA")
529529
set(object, 'surname', 'Hernandez')
@@ -552,7 +552,7 @@ test('Removing computeds', function(t) {
552552
surname: "Gonzalez",
553553
fullname: computed(computed1)
554554
})
555-
dop.addComputed(object, 'fullname', computed2)
555+
dop.set(object, 'fullname', dop.computed(computed2))
556556

557557
t.equal(object.fullname, "JOSEMA")
558558
set(object, 'surname', 'Hernandez')
@@ -588,7 +588,7 @@ test('Removing all computeds', function(t) {
588588
surname: "Gonzalez",
589589
fullname: computed(computed1)
590590
})
591-
dop.addComputed(object, 'fullname', computed2)
591+
dop.set(object, 'fullname', dop.computed(computed2))
592592

593593
t.equal(object.fullname, "JOSEMA")
594594
set(object, 'surname', 'Hernandez')

0 commit comments

Comments
 (0)