JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>

JavaScript

// model 
var model = {
    number: Math.floor(Math.random() * 10)
};

// view
function view(data) { // : UI
    var template = _.template("<h1><%=number%></h1>");
    $('body').html(template(data))
}

// intent
function update(intent) {
    switch (intent.type) {
        case 'square': model.number = model.number * model.number;
    }
    view(model);
}

$('body').on('click', 'h1', function () {
    update({type:'square'});
});

view(model);