Files
freeCodeCamp/common/app/routes/Jobs/components/Show.jsx

25 lines
511 B
JavaScript
Raw Normal View History

2015-08-29 01:00:52 -07:00
import { contain } from 'thundercats-react';
2015-09-26 22:23:56 -07:00
import ShowJob from './ShowJob.jsx';
2015-08-25 14:36:07 -07:00
2015-08-29 01:00:52 -07:00
export default contain(
{
store: 'jobsStore',
fetchAction: 'jobActions.getJob',
2015-08-31 14:32:31 -07:00
map({ currentJob }) {
return { job: currentJob };
},
getPayload({ params: { id }, job = {} }) {
2015-08-31 14:32:31 -07:00
return {
id,
isPrimed: job.id === id
2015-08-31 14:32:31 -07:00
};
},
// using es6 destructuring
shouldContainerFetch({ job = {} }, { params: { id } }
) {
return job.id !== id;
2015-08-29 01:00:52 -07:00
}
2015-08-25 14:36:07 -07:00
},
2015-09-26 22:23:56 -07:00
ShowJob
2015-08-29 01:00:52 -07:00
);