var React = require('react'), ReactDOM = require('react-dom'), classNames = require('classnames'), Core = require('./core.js').Core, ThingModal = require('./ThingModal.js'), ThingList = require('./ThingList.js'), SearchBox = require('./SearchBox.js'); var Application = React.createClass({ handleThingAdd: function () { this.refs.modalAdd.openModal(); }, handleThingEdit: function (thing) { this.refs.modalAdd.openModal(thing); }, handleThingDelete: function (thing) { console.log('del', thing) }, getInitialState: function () { return { data: [], busy: false }; }, componentDidMount: function () { this.refresh(); }, refresh: function () { var that = this; that.setState({ data: [], busy: true }); Core.thingsGet('', function (error, result) { if (error) return console.error(error); that.setState({ data: result, busy: false }); }); }, render: function () { var things = this.state.busy ?
: ; return (
{things}
); } }); module.exports = Application;