JSFiddle - React, Tailwind, and code Playground
by Proger
HTML
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.7.0/underscore-min.js"></script>
<script src="http://squizzle.me/js/sqimitive/sqimitive.min.js"></script>
JavaScript
var MyItem = Sqimitive.Sqimitive.extend()
var MyList = Sqimitive.Sqimitive.extend({
// true можно не указывать - это значение по умолчанию.
_owning: true,
_childClass: MyItem,
_childEvents: ['change'],
})
var item = new MyItem
var list1 = new MyList
list1.nest(item)
var list2 = new MyList
list2.nest(item)
alert(list1.length + ' ' + list2.length)
// alert('0 1')
alert(item._parent === list2)
// alert('TRUE')