JSFiddle - React, Tailwind, and code Playground

by abernier

HTML

<script src="https://raw.github.com/maccman/spine/master/lib/spine.js"></script>

JavaScript

var contact = (function () {
    var prototype = new Spine.Model();
    
    prototype.greet = function () {
        alert("Hi, I'm " + this.name);
    };
        
    return function (name) {
        var that = Object.create(prototype);
        
        that.name = name;
        
        return that;
    }
}());

var abernier = contact('Antoine');
abernier.greet();