I am used to computed properties in Ember Object Model. It\'s a convenient way to specify computed properties that depend on other properties.
Say fullName
To create computed properties you can use the standalone observable library mobservable.
var user = mobservable.props({
firstName: 'John',
lastName: 'Doe',
fullName: function() {
return this.firstName + this.lastName
}
});
var nameViewer = mobservable.ObservingComponent(React.createClass({
render: function() {
return ({user.fullName})
}
});
That should be the gist of it, now any change to user.firstName or lastName will rerender your nameViewer component. You can further combine this with flux implementations like redux to change the data, and push the user itself through your component tree. But note that the user object itself is not immutable (in that case it wouldn't be observable after all ;-)) Also see this trivial and slightly more interesting fiddles for some examples.