JSFiddle - React, Tailwind, and code Playground

by InsaneWookie

HTML

<script src="http://github.com/downloads/SteveSanderson/knockout/knockout-2.1.0.js"></script>
<button type='button' id='add'>add</button>
<button type='button' id='mutated'>force update</button>
<div id="short_tasks" data-bind="foreach: list">
  <div data-bind="text: title"></div>
</div>

JavaScript

var ListTest = function () {

  this.list = ko.observableArray([{title: 'item1'}]);
}

var viewModel = new ListTest();
ko.applyBindings(viewModel);

$('#add').click(function () {
  viewModel.list().push({title: 'new item'});
});

$('#mutated').click(function() {
  viewModel.list.valueHasMutated();
});