react-observe
v0.0.1
Published
Mainly useful for watching models and re-rendering when they change.
Downloads
4
Readme
Mainly useful for watching models and re-rendering when they change.
Something like this:
var user = new EventEmitter();
React.createClass({
render: funtion() {
return <p>
Name: <input type="text" name="name" value={user.name} onChange={this.handleChange} /><br />
Email: <input type="text" name="email" vaue={user.email} onChange={this.handleChange} /><br />
<Observe target={user} handler={function() {
return <a href={'mailto:' + user.email}>{user.name}</a>
}} />
</p>
},
handleChange: function(e) {
user[e.target.name] = e.target.value;
user.emit('change');
}
});