componentDidMount() { this.unsubscribe = ItemsStore.listen(this.updateState.bind(this)) }
function getContacts() { return { contacts: ContactsStore.getContacts() } }
constructor(props) { super(props) this.state = { list: ItemsStore.getList() } }
React.createClass({ handleSave:function(noteText,id){ if(id){ NoteActions.editNote({_id:id,text:noteText}); } else{ NoteActions.createNote({_id:Date.now(),text:noteText}); } }, render: function() { var note; if(this.props.id) { note=NoteStore.getNote(this.props.id); } return ( <div className="col-md-8"> <TextArea onSave={this.handleSave} id={this.props.id} noteText={note ? note.text : ''} /> </div> ) } })
React.createClass({ mixins: [ Reflux.connectFilter(projectStore, 'project', function(project) { if (project.name === this.props.params.name) { return project; } else { if (this.state) { return this.state.project; } else { return projectStore.getInitialState(); } } }) ], statics: { willTransitionTo: function(transition, params) { ProjectActions.read({name: params.name}); BuildActions.readAll({projectName: params.name}); } }, render: template.locals({ ProjectHeader: ProjectHeader, Builds: Builds, DateTime: CommonComponents.DateTime, Duration: CommonComponents.Duration }) })
email: '' }; ContactsStore.upsertContact(new_contact); },
React.createClass({ componentDidMount() { this.unsubscribe = ShoppingListStore.listen(this.onChange); }, componentWillUnmount() { }, onChange() { this.setState( { items: ShoppingListStore.getAll() } ); }, addItem( newItem ) { }, getInitialState() { return { items : ShoppingListStore.getAll() }; }, render() {
contact = ContactsStore.getContact(parseInt(this.getParams().id)); e.preventDefault(); ContactsStore.upsertContact(this.state.contact);
handleSubmit: function(e) { e.preventDefault(); ContactsStore.upsertContact(this.state.contact);