Skip to content

wejendorp/model-dirty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

model-dirty

Plugin to make model send only dirty fields on save/update. Works by replacing model#toJSON in model#save

Installation

Install with component(1):

$ component install wejendorp/model-dirty

Usage

var dirty = require('model-dirty');
var model = require('model');
var myModel = model('myModel')
  .attr('id')
  // ...
  ;

myModel.use(dirty);

// myModel#save is now dirty attributes only

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published