JSFiddle - React, Tailwind, and code Playground

by Leo Cavalcante

HTML

<script src="https://raw.github.com/leocavalcante/prototyping/master/prototyping.js"></script>
<a href="#">click me</a>

JavaScript

Prototyping.module('app', function(app) {

    function Foo(a) {
      this.a = a;
    }

    Foo.prototype.b = function() {
      return this.a;
    };

    Prototyping.extend(Bar, Foo);
    function Bar() {
      this.constructor.apply(this, arguments);
    }

    Bar.prototype.c = function(event) {
      console.log(this._super_.b.call(this));
    };
    
    app.Bar = Bar;
    return app;
}, this);

console.log(app);

var bar = Prototyping.create(app.Bar, 'test');
window.document.getElementsByTagName('a')[0].onclick = Prototyping.delegate(bar, bar.c);