compose-selectors

0.0.2 • Public • Published

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
}))

Package Sidebar

Install

npm i compose-selectors

Weekly Downloads

1

Version

0.0.2

License

ISC

Unpacked Size

6.21 kB

Total Files

7

Last publish

Collaborators

  • arminas