Skip to content

katilius/compose-selectors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Utility to reduce boilerplate code while using selectors together with Redux mapStateToProps

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published