lib/runtime.js
function (currentEl, nameFn, valueFn) {
  var attrName = subscribe.call(this, nameFn, null, function (value) {
    VM.removeAttribute(currentEl(), this.value);
    VM.setAttribute(currentEl(), this.value = value, attrValue.value);
  });

  var attrValue = subscribe.call(this, valueFn, null, function (value) {
    VM.setAttribute(currentEl(), attrName.value, this.value = value);
  });

  return VM.setAttribute(currentEl(), attrName.value, attrValue.value);
}
function (currentEl, nameFn, valueFn) {
  var attrName = subscribe.call(this, nameFn, null, function (value) {
    VM.removeAttribute(currentEl(), this.value);
    VM.setAttribute(currentEl(), this.value = value, attrValue.value);
  });

  var attrValue = subscribe.call(this, valueFn, null, function (value) {
    VM.setAttribute(currentEl(), attrName.value, this.value = value);
  });

  return VM.setAttribute(currentEl(), attrName.value, attrValue.value);
}
function ( currentEl , nameFn , valueFn ) { var attrName = subscribe . call ( this , nameFn , null , function ( value ) { VM . removeAttribute ( currentEl ( ) , this . value ) ; VM . setAttribute ( currentEl ( ) , this . value = value , attrValue . value ) ; } ) ; var attrValue = subscribe . call ( this , valueFn , null , function ( value ) { VM . setAttribute ( currentEl ( ) , attrName . value , this . value = value ) ; } ) ; return VM . setAttribute ( currentEl ( ) , attrName . value , attrValue . value ) ; }
Set an elements attribute. We accept the current element a function
because when a tag name changes we will lose reference to the actively
rendered element.

@param {Function} currentEl
@param {Function} nameFn
@param {Function} valueFn
Set an elements attribute . We accept the current element a function because when a tag name changes we will lose reference to the actively rendered element .