Utility to reduce boilerplate code while using selectors together with Redux mapStateToProps
npm install compose-selectorsjs
connect((state) => ({
firstTodo: getFirstTodo(state),
todoCount: getTodoCount(state),
currentUser: getCurrentUser(state),
notifications: getNotifications(state)
}))
`
Can be replaced with:
`js
connect(composeSelectors({
firstTodo: getFirstTodo,
todoCount: getTodoCount,
currentUser: getCurrentUser,
notifications: getNotifications
}))
``