Skip to content

Instantly share code, notes, and snippets.

View mohitmayank's full-sized avatar
🎯
Focusing

Mohit Jain mohitmayank

🎯
Focusing
View GitHub Profile
@mohitmayank
mohitmayank / model.js
Last active December 14, 2015 05:49 — forked from philfreo/model.js
var Model = Backbone.Model.extend({
/**
* Override main attribute getter to handle mutators.
* Looks for an object on the model called 'mutators', keyed by key name,
* with values of either the getter function or an object like:
* { get: function() {}, set: function() {} }
*/
get: function(attr) {
var val,