src/packages/recompose/withStateHandlers.js
Function withStateHandlers
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const withStateHandlers = (initialState, stateUpdaters) => BaseComponent => {
const factory = createFactory(BaseComponent)
class WithStateHandlers extends Component {
state = typeof initialState === 'function'
Delete ··
Open
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
Open
mayBeEvent.persist()
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ··}⏎····
with }
Open
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
Open
this.setState((state, props) =>
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
Open
if (mayBeEvent && typeof mayBeEvent.persist === 'function') {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
Open
handler(state, props)(mayBeEvent, ...args)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········
with ······
Open
Open
// we need to persist SyntheticEvent
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ⏎······stateUpdaters,⏎······handler·=>·(mayBeEvent,·...args
with stateUpdaters,·handler·=>·(⏎······mayBeEvent,⏎······...args⏎····
Open
Open
stateUpdaters = mapValues(
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
Open
// Having that functional form of setState can be called async
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/