Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/katilius/compose-selectors
Utility to reduce boilerplate code while using selectors together with Redux mapStateToProps
https://github.com/katilius/compose-selectors
react redux selector
Last synced: 15 days ago
JSON representation
Utility to reduce boilerplate code while using selectors together with Redux mapStateToProps
- Host: GitHub
- URL: https://github.com/katilius/compose-selectors
- Owner: katilius
- Created: 2018-03-01T11:26:11.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T17:49:53.000Z (about 2 years ago)
- Last Synced: 2024-10-18T09:52:03.466Z (3 months ago)
- Topics: react, redux, selector
- Language: JavaScript
- Homepage:
- Size: 733 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Compose Selectors
Helper function that reduces boilerplate code needed while using selectors alongside
connect function.```js
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
}))
```