move jobs flux, use createClass for react

This commit is contained in:
Berkeley Martinez
2015-07-25 13:58:26 -07:00
parent 6306580d84
commit 0d628f57bb
6 changed files with 47 additions and 56 deletions

View File

@ -1,15 +0,0 @@
import { Actions } from 'thundercats';
export default class JobsActions extends Actions {
constructor() {
super();
}
static displayName = 'JobsActions'
getJob(id) {
return { id };
}
getJobs(params) {
return { params };
}
}

View File

@ -1,20 +1,17 @@
import React, { PropTypes } from 'react'; import React, { PropTypes } from 'react';
import { createContainer } from 'thundercats'; import { contain } from 'thundercats';
import { Grid, Row } from 'react-bootstrap'; import { Grid, Row } from 'react-bootstrap';
@createContainer({ export default contain(
store: 'JobsStore' {
}) store: 'jobsStore',
export default class extends React.Component { actions: 'jobActions'
constructor(props) { },
super(props); React.createClass({
} displayName: 'Jobs',
propTypes: {
static displayName = 'Jobs'
static propTypes = {
jobs: PropTypes.array jobs: PropTypes.array
} },
render() { render() {
return ( return (
@ -25,4 +22,5 @@ export default class extends React.Component {
</Grid> </Grid>
); );
} }
} })
);

View File

@ -1,13 +1,11 @@
import React, { PropTypes } from 'react'; import React, { PropTypes } from 'react';
export default class extends React.Component { export default React.createClass({
constructor(props) { displayName: 'JobsList',
super(props); propTypes: {
} foo: PropTypes.string
},
static displayName = 'JobsList'
static propTypes = {}
render() { render() {
return null; return null;
} }
} });

View File

@ -1,9 +0,0 @@
import { Store } from 'thundercats';
export default class JobsStore extends Store {
constructor(cat) {
super();
let JobsActions = cat.getActions('JobsActions');
}
static displayName = 'JobsStore'
}

View File

@ -0,0 +1,11 @@
import { Actions } from 'thundercats';
export default Actions({
getJob(id) {
return { id };
},
getJobs(params) {
return { params };
}
})
.refs({ displayName: 'JobsActions' });

View File

@ -0,0 +1,8 @@
import { Store } from 'thundercats';
export default Store()
.refs({ displayName: 'JobsStore' })
.init(({ instane: jobsStore, args: [cat] }) => {
let jobsActions = cat.getActions('JobsActions');
jobsStore.register(jobsActions);
});