Skip to content

Instantly share code, notes, and snippets.

@nnarhinen nnarhinen/some.html
Created Nov 26, 2013

What would you like to do?
Make your plain javascript objects and arrays observable with just jquery, jsfiddle:
<p>Observable plain javascript objects with jQuery (rendered with transparency.js)</p>
<ul class="items">
<li class="title"></li>
<p>Wait for a few seconds and watch the last item in list</p>
var items = [
{title: "First"},
{title: "Second"},
{title: "Third"}
$(items).on('change', function() { $('.items').render(items); });
setTimeout(function() {
var itm = items[2];
itm.title = 'Changed';
}, 5000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.