JSFiddle - React, Tailwind, and code Playground

by Deepak Anand

JavaScript

///An attempt to mimic dojo declare's multiple inheritance in plain JS as it applies to the example at http://dojotoolkit.org/reference-guide/1.10/dojo/_base/declare.html#multiple-inheritance

var VanillaSoftServe = function () {        
        return {
            quality: "best",
            constructor: function () {
                console.debug ("adding soft serve");
            }
        };
    };

var OreoMixin  = function(){  
  return {
      constructor: function(){
          console.debug("mixing in oreos");
      },
      kind: "plain"
  };
};

var CookieDoughMixin  = function(){  
  return {
      constructor: function(){
          console.debug("mixing in cookie dough");
      },
      chunkSize: "medium"
  };
};



var Blizzard = function(){
  
  var self = VanillaSoftServe(), superConst = self.constructor,
      mixin1 = OreoMixin(), mixinConst1 = mixin1.constructor,
      mixin2 = CookieDoughMixin(), mixinConst2 = mixin2.constructor;
      
  
  self.constructor = function(){
     superConst.call(self);
     mixinConst1.call(self);
     mixinConst2.call(self);
     
     console.log('blizzard');
  };  
  return self;
};

debugger;
var yummyTreat = Blizzard();
yummyTreat.constructor();