JSFiddle - React, Tailwind, and code Playground

by johnthethird

HTML

<script src="https://raw.github.com/Shopify/batman/master/lib/es5-shim.js"></script>
<script src="https://raw.github.com/Shopify/batman/v0.8.0/lib/batman.js"></script>
<div id="container">
    <h3>Batman v0.8</h3>
    <button data-event-click="addObjects">Add Objects</button>
    <button data-event-click="addModels">Add Models</button>
    <hr />
  Log:
    <div id="logs"></div>
  <hr />

</div>

CoffeeScript

class Batman.SlimModel extends Batman.Model
  constructor: (idOrAttributes = {}) ->
    super(idOrAttributes)

window.Robin = class Robin extends Batman.App
  @profile: (msg, f) =>
    start = new Date
    f.call()
    end = new Date
    $("#logs").prepend("<p>#{msg}: #{end - start}ms</p>")
    
  @addObjects: () =>
    Robin.profile "addObjects", =>
      for j in [0..20]
        new Batman.Object({"body": "pow"})
  
  @addModels: () =>
    Robin.profile "addModels", =>
      for j in [0..90]
        new Batman.Model({"body": "pow"})

class Robin.Article extends Batman.Model
  #@encode 'id', 'body'
    
Robin.run()