/** @jsx React.DOM */ 'use strict'; var _ = require('lodash'); var React = require('react'); var api = require('./api.js'); var AnimatableComponent = require('./AnimatableComponent.js'); var TableView = React.createClass({ getInitialState: function() { return { items: [], updatedItem: null }; }, componentWillMount: function() { this.load(); }, load: function() { api.load(function(res) { if(res.ok && !res.noContent) { this.setState({ items: res.body }); } }.bind(this)); }, handleAnimationIteration: function(item, e) { console.log('Item ' + item.id + ' animation iteration count: ' + item.animationIterationCount); }, handleAnimationStart: function(item, e) { console.log('Item ' + item.id + ' is animating'); }, handleAnimationStop: function(item, e) { console.log('Item ' + item.id + ' has stopped animating'); }, render: function() { var rows = _.map(this.state.items, function(item) { return ( { item.A } { item.B } { item.C } { item.D } ); }).bind(this); return ( { rows }
A B C D
); } }); module.exports = TableView;