lib/attrs.js
function liveAttrsUpdate(newVal) {
		var newAttrs = live.getAttributeParts(newVal),
			name;
		for (name in newAttrs) {
			var newValue = newAttrs[name],
				// `oldAttrs` was set on the last run of setAttrs in this context
				//  (for this element and compute)
				oldValue = oldAttrs[name];
			// Only fire a callback
			//  if the value of the attribute has changed
			if (newValue !== oldValue) {
				// set on DOM attributes (dispatches an "attributes" event as well)
				domMutateNode.setAttribute.call(el, name, newValue);
				// get registered callback for attribute name and fire
				var callback = viewCallbacks.attr(name);
				if (callback) {
					callback(el, {
						attributeName: name,
						scope: scope,
						options: options
					});
				}
			}
			// remove key found in new attrs from old attrs
			delete oldAttrs[name];
		}
		// any attrs left at this point are not set on the element now,
		// so remove them.
		for (name in oldAttrs) {
			domMutateNode.removeAttribute.call(el, name);
		}
		oldAttrs = newAttrs;
	}
function liveAttrsUpdate(newVal) {
		var newAttrs = live.getAttributeParts(newVal),
			name;
		for (name in newAttrs) {
			var newValue = newAttrs[name],
				// `oldAttrs` was set on the last run of setAttrs in this context
				//  (for this element and compute)
				oldValue = oldAttrs[name];
			// Only fire a callback
			//  if the value of the attribute has changed
			if (newValue !== oldValue) {
				// set on DOM attributes (dispatches an "attributes" event as well)
				domMutateNode.setAttribute.call(el, name, newValue);
				// get registered callback for attribute name and fire
				var callback = viewCallbacks.attr(name);
				if (callback) {
					callback(el, {
						attributeName: name,
						scope: scope,
						options: options
					});
				}
			}
			// remove key found in new attrs from old attrs
			delete oldAttrs[name];
		}
		// any attrs left at this point are not set on the element now,
		// so remove them.
		for (name in oldAttrs) {
			domMutateNode.removeAttribute.call(el, name);
		}
		oldAttrs = newAttrs;
	}
function liveAttrsUpdate ( newVal ) { var newAttrs = live . getAttributeParts ( newVal ) , name ; for ( name in newAttrs ) { var newValue = newAttrs [ name ] , // `oldAttrs` was set on the last run of setAttrs in this context //  (for this element and compute) oldValue = oldAttrs [ name ] ; // Only fire a callback //  if the value of the attribute has changed if ( newValue !== oldValue ) { // set on DOM attributes (dispatches an "attributes" event as well) domMutateNode . setAttribute . call ( el , name , newValue ) ; // get registered callback for attribute name and fire var callback = viewCallbacks . attr ( name ) ; if ( callback ) { callback ( el , { attributeName : name , scope : scope , options : options } ) ; } } // remove key found in new attrs from old attrs delete oldAttrs [ name ] ; } // any attrs left at this point are not set on the element now, // so remove them. for ( name in oldAttrs ) { domMutateNode . removeAttribute . call ( el , name ) ; } oldAttrs = newAttrs ; }
set up a callback for handling changes when the compute changes
set up a callback for handling changes when the compute changes