-
-
Save Raynos/4366291 to your computer and use it in GitHub Desktop.
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
var leveldb = require("levelidb") | |
var LevelScuttle = require("level-scuttle") | |
var Model = require("scuttlebutt/model") | |
var db = leveldb("/tmp/level-1", { createIfMissing: true, encoding: "json" }) | |
var db2 = leveldb("/tmp/level-2", { createIfMissing: true, encoding: "json" }) | |
var methods = LevelScuttle(db1, { | |
"a": Model | |
}) | |
var methods2 = LevelScuttle(db2, { | |
"a": Model | |
}) | |
var stream1 = methods.replicate({ start: "a:", end: "a;" }) | |
var stream2 = methods2.replicate({ start: "a:", end: "a;" }) | |
livefeed(db, { start: "a:", end: "a;" }) | |
.on("data", function (change) { | |
assert.equal(change.key, "a:1") | |
assert.deepEqual(change.value, { foo: "bar" }) | |
}) | |
// puts a:1 to that value | |
// puts ~level-scuttle~a:1~ts~source to that value ? | |
// puts ~level-scuttle~~a:1~source~ts to that value ? | |
methods2.put("a:1", { foo: "bar" }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment