index.js
function vel (rend) {
  assert.equal(typeof rend, 'function')

  var update = null
  render.toString = toString
  render.render = render
  render.vtree = vtree
  return render

  // render the element's vdom tree to DOM nodes
  // which can be mounted on the DOM
  // any? -> DOMNode
  function render (state) {
    if (update) return update(state)
    const loop = mainLoop(state, renderFn(rend), vdom)
    update = loop.update
    return loop.target
  }

  // render the element's vdom tree to a string
  // any? -> str
  function toString (state) {
    return toHtml(renderFn(rend)(state))
  }

  // Get the element's vdom tree.
  // any? -> obj
  function vtree (state) {
    return rend(h, state)
  }
}
function vel (rend) {
  assert.equal(typeof rend, 'function')

  var update = null
  render.toString = toString
  render.render = render
  render.vtree = vtree
  return render

  // render the element's vdom tree to DOM nodes
  // which can be mounted on the DOM
  // any? -> DOMNode
  function render (state) {
    if (update) return update(state)
    const loop = mainLoop(state, renderFn(rend), vdom)
    update = loop.update
    return loop.target
  }

  // render the element's vdom tree to a string
  // any? -> str
  function toString (state) {
    return toHtml(renderFn(rend)(state))
  }

  // Get the element's vdom tree.
  // any? -> obj
  function vtree (state) {
    return rend(h, state)
  }
}
function vel ( rend ) { assert . equal ( typeof rend , 'function' ) var update = null render . toString = toString render . render = render render . vtree = vtree return render // render the element's vdom tree to DOM nodes // which can be mounted on the DOM // any? -> DOMNode function render ( state ) { if ( update ) return update ( state ) const loop = mainLoop ( state , renderFn ( rend ) , vdom ) update = loop . update return loop . target } // render the element's vdom tree to a string // any? -> str function toString ( state ) { return toHtml ( renderFn ( rend ) ( state ) ) } // Get the element's vdom tree. // any? -> obj function vtree ( state ) { return rend ( h , state ) } }
initialize a new virtual element fn -> null
initialize a new virtual element fn - > null