Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
an example demoing a DSL for backbone objects
class Something extends Backbone.Model
is: ["validatable", "sortable"]
validations:
phoneNumber:
required:
message: "this is a custom message for when you're missing the phone number!"
matches: /\d{10}/
sortable:
by: "firstName"
order: "desc"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.