@coding_lawyer
import { withProps, branch, compose, withState } from
‘recompose'
const withWarning = () => () => (
You need to have more than one character
)
const enhance = compose(
withState('state', 'setState', 'dark'),
withProps(({ list, state }) => ({
filtered: list.filter(char => char.side === state)
})),
branch(({ filtered }) => filtered.length <= 1, withWarning)
)