JSFiddle - React, Tailwind, and code Playground

by abernier

HTML

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

CoffeeScript

###
class Contact extends Spine.Model
  constructor: (name) ->
    @name = name
  
  greet: ->
    alert("Hi, I'm " + this.name)

abernier = new Contact('Antoine')
abernier.greet()

window.abernier = abernier
###

contact = (->
    prototype = Object.create(Spine.Model.prototype)
    prototype.greet = ->
        alert "Hi, I'm #{@name}"
    
    return (name) ->
        that = Object.create(prototype)
        
        that.name = name
        
        return that
)()
        
window.abernier = contact('Antoine')
abernier.greet()