-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jim de Beer
committed
Aug 25, 2016
1 parent
0d369fb
commit a3d65c7
Showing
14 changed files
with
12 additions
and
64 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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
'use strict' | ||
// not really nice maybe remove this for hub and state | ||
var Hub = require('./') | ||
const Hub = require('./') | ||
module.exports = function (val, stamp) { | ||
return new Hub(val, stamp) | ||
// what about allowing objects for stamp that have type, src | ||
// val then calling vstamp in these functions? makes it super easy | ||
return new Hub(val, stamp || false) | ||
} |
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
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
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
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
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 |
---|---|---|
@@ -1,59 +1,32 @@ | ||
'use stirct' | ||
const vstamp = require('vigour-stamp') | ||
const isObj = require('vigour-util/is/obj') | ||
// const slist = {} | ||
|
||
// allways need spawn stamp for this, something like spawned from or something... | ||
exports.define = { | ||
extend: { | ||
set (set, val, stamp, nocontext, isNew) { | ||
// var created | ||
const slist = this.root.loop | ||
// console.logx/(slist) | ||
|
||
const obj = isObj(val) | ||
if (obj) { | ||
if (val.stamp) { | ||
stamp = val.stamp | ||
|
||
if (!slist[stamp]) { | ||
slist[stamp] = true | ||
// created = true | ||
} | ||
} | ||
} | ||
if (stamp && this.stamp) { | ||
if (Number(vstamp.val(stamp)) < Number(vstamp.val(this.stamp))) { | ||
if (!obj) { | ||
// logmismatch(this, val, stamp) | ||
return | ||
} else if (val.val) { | ||
// logmismatch(this, val, stamp) | ||
delete val.val | ||
} | ||
} | ||
} | ||
// console.log(this.path()) | ||
const changed = set.call(this, val, stamp, nocontext, isNew) | ||
// if (created) { | ||
// way too heavy ofc | ||
// process.nextTick(() => { | ||
// vstamp.close(stamp) | ||
// delete slist[stamp] | ||
// }) | ||
// } | ||
return changed | ||
} | ||
}, | ||
isSync: { value: true } | ||
isSync: true | ||
} | ||
|
||
// function logmismatch (t, val, stamp) { | ||
// console.log( | ||
// 'STAMP-MISMATCH: ', t.getRoot().id, t.path(), | ||
// '\n current:', t.val, | ||
// '\n new:', val, | ||
// '\n new-stamp:', stamp, | ||
// '\n current-stamp:', t.stamp | ||
// ) | ||
// } |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
'use strict' | ||
require('./queue') | ||
require('./clients') | ||
// require('./clients') | ||
// require('./context') | ||
|
||
/* | ||
|
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