Last active
February 18, 2016 19:30
-
-
Save kwhinnery/2234a269add3cc707646 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 map = client.sync.map('uniqueName'); | |
map.set('foo', { bar: 42 }).then(function() { | |
console.log('set it!'); | |
}).catch(function(err) { | |
console.log('dang it, dont have access'); | |
}); | |
// same as above... | |
map.set('foo', { bar: 42 }, function(err) { | |
if (err) return console.log('dang it, dont have access'); | |
console.log('set it!'); | |
}); | |
map.on('value', function(value) { | |
console.log('value updated'); | |
}); | |
map.on('error', function(err) { | |
if (err.code == 403) { | |
console.log('sync failed because you dont have access'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment