Skip to content

Instantly share code, notes, and snippets.

@heymichaelp
Last active August 29, 2015 14:03
Show Gist options
  • Save heymichaelp/7cadc93c607894329f93 to your computer and use it in GitHub Desktop.
Save heymichaelp/7cadc93c607894329f93 to your computer and use it in GitHub Desktop.
Query Objects: Example Implementation
var CreateStudent = function(student) {
this.student = student
}
CreateStudent.prototype = _.extend(CreateStudent.prototype, {
run: function() {
...
},
persist: function() {
return new CreateStudentQuery(this.student).run()
},
...
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment