| Total Complexity | 1 |
| Complexity/F | 1 |
| Lines of Code | 19 |
| Function Count | 1 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import { connect } from 'react-redux' |
||
| 2 | import { getPostBrief, getEditedBrief } from 'post/state/selectors' |
||
| 3 | import { editPostBrief } from 'post/state/actions' |
||
| 4 | import Brief from 'post/components/Brief' |
||
| 5 | |||
| 6 | const mapStateToProps = state => { |
||
| 7 | const editedBrief = getEditedBrief(state) |
||
| 8 | const brief = getPostBrief(state) |
||
| 9 | return { |
||
| 10 | brief: editedBrief || '', |
||
| 11 | isEdited: editedBrief !== brief |
||
| 12 | } |
||
| 13 | } |
||
| 14 | |||
| 15 | const mapDispatchToProps = { |
||
| 16 | editPostBrief |
||
| 17 | } |
||
| 18 | |||
| 19 | export default connect(mapStateToProps, mapDispatchToProps)(Brief) |
||
| 20 |