drcmda / drcmda/react-contextual

Having a selectors property

Open
#29 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
638
Forks
21
PR merge metrics
No merged PRs in 30d

Description

Maybe it would be good to declare selectors inside the definition of the store and pass them the store automatically, so we don't have to pass the store back when we call the selectors.

Something like this
```javascript
createStore({
list: [...],
search: '',
selectors: {
getFilteredList: ({list, search}) => list.filter(e => e.includes(search))
}
})
```
And then we could call it with
```javascipt
store.selectors.getFilteredList()
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.