Skip to content

Instantly share code, notes, and snippets.

@roykolak
Created June 26, 2011 19:02
Show Gist options
  • Save roykolak/1047864 to your computer and use it in GitHub Desktop.
Save roykolak/1047864 to your computer and use it in GitHub Desktop.
Store = function(client) {
return {
run: function(method, params, callback) {
var modifiedCallback = function(error, result) {
callback(result);
};
params.push(modifiedCallback);
client[method].apply(client, params);
},
addBuddyWaiting: function(buddy, callback) {
this.run('rpush', ['buddies', buddy], callback);
},
getBuddiesWaiting: function(callback) {
this.run('lrange', ['buddies', 0, -1], callback);
}
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment