Skip to content

Instantly share code, notes, and snippets.

@aleksclark
Created June 13, 2013 18:02
Show Gist options
  • Save aleksclark/5775880 to your computer and use it in GitHub Desktop.
Save aleksclark/5775880 to your computer and use it in GitHub Desktop.
self.permConstructor = function(perm) {
return ko.computed({
read: function(){self.hasPerm(perm)},
write: function(val){
if (val) {
self.permissions.push(perm);
} else {
self.permissions.remove(perm);
}
}
});
}
self.presenter = self.permConstructor('canvas');
self.sendAudio = self.permConstructor('audio');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment