Permalink
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (30 sloc) 657 Bytes
<style>
body {
padding: 50px;
font: 14px Helvetica, Arial;
}
label {
display: block;
clear: both;
}
</style>
<article>
<h1>{ title || 'Untitled' }</h1>
<p>{ description.slice(0, 5) }</p>
</article>
<script src="./reactive.js"></script>
<script>
var reactive = require('reactive');
var Emitter = require.latest('component~emitter');
var article = {
title: 'Reactive',
description: 'Some description here.'
};
Emitter(article);
var el = document.querySelector('article');
reactive(el, article);
setTimeout(function(){
article.title = null;
article.emit('change title');
}, 2000);
</script>