src/durruti.js
function decorate (Comp) {
  var component

  // instantiate classes
  if (typeof Comp === 'function') {
    component = new Comp()
  } else {
    // make sure we don't change the id on a cached component
    component = Object.create(Comp)
  }

  // components get a new id on render,
  // so we can clear the previous component cache.
  component._durrutiId = String(componentIndex++)

  // cache component
  componentCache.push({
    id: component._durrutiId,
    component: component
  })

  return component
}
function decorate (Comp) {
  var component

  // instantiate classes
  if (typeof Comp === 'function') {
    component = new Comp()
  } else {
    // make sure we don't change the id on a cached component
    component = Object.create(Comp)
  }

  // components get a new id on render,
  // so we can clear the previous component cache.
  component._durrutiId = String(componentIndex++)

  // cache component
  componentCache.push({
    id: component._durrutiId,
    component: component
  })

  return component
}
function decorate ( Comp ) { var component // instantiate classes if ( typeof Comp === 'function' ) { component = new Comp ( ) } else { // make sure we don't change the id on a cached component component = Object . create ( Comp ) } // components get a new id on render, // so we can clear the previous component cache. component . _durrutiId = String ( componentIndex ++ ) // cache component componentCache . push ( { id : component . _durrutiId , component : component } ) return component }
decorate a basic class with durruti specific properties
decorate a basic class with durruti specific properties