Rivets issue - unbinding each
Potential issue with rivets. After unbinding, adding new elements to the originally bound array triggers a view update.
HTML
<script src="https://rawgit.com/mikeric/rivets/v0.6.7/dist/rivets.js"></script>
<ul id="list">
<li rv-each-item="items" rv-text="item.text" />
</ul>
JavaScript
var items = [];
// results in [{text: "hello 1", ...}]
items.push.apply(items, [0, 1, 2, 3, 4].map(function (val) {
return {
text: "hello " + val
};
}));
var rvView = rivets.bind(document.querySelector("#list"), {
items: items
});
// Remove all elements from items
items.splice(0, items.length);
rvView.unbind();
// Should now be disconnected from any rivets observers
items.push.apply(items, [5, 6, 7, 8, 9].map(function (val) {
return {
text: "hello " + val
};
}));