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

View File

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