JSFiddle - React, Tailwind, and code Playground

by Eric Hynds

HTML

<script src="http://underscorejs.org/underscore-min.js"></script>
<script src="http://backbonejs.org/backbone.js"></script>

CSS

colo

JavaScript

var BaseView = Backbone.View.extend({
    constructor: function() {
        this.subviews = {};
        Backbone.View.apply(this, arguments);
    }
});

var ContentView = BaseView.extend({
    initialize: function() {
        this.subviews.sidebar = new SidebarView()l
    }
});

var HeaderView = BaseView.extend({
    initialize: function() {
        this.subviews.menu = new MenuView();
    }
});

var sidebar = new SidebarView();
var header = new HeaderView();

// shared protos

var view1 = new BaseView();
var view2 = new BaseView();

// this will change the color on the prototype chain
// for both view1 and view2
view1.__proto__.color = "blue"; 
console.log(view1, view2);