racer-react
v0.0.34
Published
Racer.js wrapper for React.js which allows to create realtime isomorphic applications with offline support.
Downloads
13
Maintainers
Readme
Racer.js wrapper for React which allows to create realtime isomorphic applications with offline support.
In a few words racer-react allows you to query racer model in declarative way from react-router handlers:
import React, { Component } from "react";
import { Connect } from "racer-react";
import { connectRacer } from 'racer-react';
class TestPage extends Component {
_submit( ev ){
ev.preventDefault();
this.props.racerModel.add( "test", {
message: this.refs.message.value,
});
}
render() {
return (
<div>
<form onSubmit={ this._submit.bind( this ) }>
<textarea ref="message" } />
<button>Add</button>
</form>
<ul>
{ this.props.testList.map( (item, i) => {
<li key={ i }>{ item.id }</li>
}}
</ul>
</div>
)
}
}
export default connectRacer(
query => {
query( "test", {} ).pipeAs( "testList" );
},
)(TestPage);
Full list of racer features is here.
Usage examples.