0.0.2 • Published 6 years ago

compose-selectors v0.0.2

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

Compose Selectors

Helper function that reduces boilerplate code needed while using selectors alongside connect function.

connect((state) => ({
  firstTodo: getFirstTodo(state),
  todoCount: getTodoCount(state),
  currentUser: getCurrentUser(state),
  notifications: getNotifications(state)
}))

Can be replaced with:

connect(composeSelectors({
  firstTodo: getFirstTodo,
  todoCount: getTodoCount,
  currentUser: getCurrentUser,
  notifications: getNotifications
}))