"use strict";
var React = require('react');
var assign = require('object-assign');
//var isObject = require('lodash/lang/isObject');
//var isFunction = require('lodash/lang/isFunction');

/**
 * Create a component with a mixin except id the component is mixin only.
 * @param {object}  mixin - The component mixin.
 * @param {Boolean} isMixinOnly - define if the component is a mixin only.
 * @return {object} - {component} the built react component.
 */
function createComponent(mixin, isMixinOnly){
    if (isMixinOnly){
      return undefined;//Error('Your class publish a mixin only...');
    }
    return {component: React.createClass(mixin)};
}

/**
 * Build a module with a mixin and a React component.
 * @param  {object} componentMixin - Mixin of the component.
 * @param {boolean} isMixinOnly - Bolean to set .
 * @return {object} {mixin: 'the component mixin', component: 'the react instanciated component'}
 */
module.exports = function(componentMixin, isMixinOnly){

  return assign( {
    mixin: componentMixin
    /*extend: function extendMixin(properties){
      if(isFunction(componentMixin)){
        throw new Error('You cannot extend a mixin function');
      }
      if(!isObject(properties)){
        throw new Error('properties should be an object');
      }
      return assign({}, componentMixin, properties);
    },*/
  }, createComponent(componentMixin, isMixinOnly));
};

@@ -1,21 +1,9 @@
-%22use strict%22;%0Avar
+const
  Rea
@@ -25,19 +25,21 @@
 eact');%0A
-var
+const
  assign 
@@ -175,17 +175,16 @@
 );%0A%0A/**%0A
- 
 * Create
@@ -248,17 +248,16 @@
 n only.%0A
- 
 * @param
@@ -296,17 +296,16 @@
  mixin.%0A
- 
 * @param
@@ -370,17 +370,16 @@
 n only.%0A
- 
 * @retur
@@ -430,17 +430,16 @@
 ponent.%0A
- 
 */%0Afunct
@@ -497,24 +497,26 @@
 MixinOnly)%7B%0A
+  
       return
@@ -520,63 +520,12 @@
 urn 
-undefined;//Error('Your class publish a mixin only...')
+null
 ;%0A  
@@ -585,17 +585,16 @@
 %0A%7D%0A%0A/**%0A
- 
 * Build 
@@ -630,33 +630,32 @@
 eact component.%0A
- 
 * @param  %7Bobjec
@@ -698,17 +698,16 @@
 ponent.%0A
- 
 * @param
@@ -747,17 +747,16 @@
 o set .%0A
- 
 * @retur
@@ -844,17 +844,16 @@
 onent'%7D%0A
- 
 */%0Amodul
@@ -868,24 +868,32 @@
 s = function
+ builder
 (componentMi
@@ -911,17 +911,18 @@
 nOnly)%7B%0A
-%0A
+  
   return
@@ -933,360 +933,49 @@
 ign(
- %7B
 %0A    
-mixin: componentMixin%0A    /*extend: function extendMixin(properties)%7B%0A      if(isFunction(componentMixin))%7B%0A        throw new Error('You cannot extend a mixin function');%0A      %7D%0A      if(!isObject(properties))%7B%0A        throw new Error('properties should be an object');%0A      %7D%0A      return assign(%7B%7D, componentMixin, properties);%0A    %7D,*/%0A  %7D,
+    %7Bmixin: componentMixin%7D,%0A       
  cre
@@ -1015,14 +1015,19 @@
 xinOnly)
+%0A    
 );%0A%7D;%0A

clean component/builder