-
-
Save dscape/6910c2fec43e4f057138 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 db_name = 'hackaton_' + (~~(Math.random() * 1e9)).toString(36); | |
Pouch('idb://'+db_name, function (err, db) { | |
if(err) { | |
return console.log('yay all live coding things fail right?'); | |
} | |
var pouch=db; | |
pouch.put({_id: '1', bar: 'baz'}, function () { | |
pouch.get('1', function (err, doc) { console.log(doc); }); | |
Pouch.replicate('idb://' + db_name, 'http://localhost:2020/foobar2003', function(err, changes) { | |
console.log('omg hi!'); | |
console.log('got changes', changes); | |
}); | |
}); | |
}); |
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 db_name = 'hackaton_' + (~~(Math.random() * 1e9)).toString(36); | |
var pouch; | |
Pouch('idb://'+db_name, function (err, db) { | |
pouch=db; | |
}) | |
pouch.put({_id: '1', bar: 'baz'}); | |
pouch.get('1', function (err, doc) { console.log(doc); }) | |
Pouch.replicate('idb://' + db_name, 'http://localhost:2020/foobar2003', function(err, changes) { | |
console.log('omg hi!') | |
console.log('got changes', changes); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment