/*! obs-model 0.5.1 Original author Alan Plum . Released into the Public Domain under the UNLICENSE. @preserve */ var aug=require("aug"),obs=require("obs"),noop=function(){};function model(t,i){function r(t){t=t||{};this._destructors=[];var i={};var r={};var s,o,e;for(s in this.model.attrs){o=this.model.attrs[s]||{};if(o.write||o.read){this[s]=obs.computed({lazy:o.lazy,write:o.write,read:o.read?noop:o.read,context:this});if(o.read){i[s]=o.read}if(o.watch){r[s]=[].concat(o.watch)}}else if(t.hasOwnProperty(s)){this[s]=obs.prop(t[s])}else{this[s]=obs.prop()}}for(s in i){this[s].read=i[s]}for(s in r){for(e=0;e