contactually / contactually/redux-capacitor
Merge Filters when using performAction
- Dominant language
- JavaScript
- Stars
- 9
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Need some more input into how this would effect other use cases, but here is the one I just ran into:
Fetching a list of items, where I already have a resource set up with `autoload: false`, and in `componentWillReceiveProps`, I may fetch.
In `cWRP`:
```js
collection.performAction('list', { filters: {'createdAt.after': 'yesterday'}})
```
Then I had a different component looking at the filters set on this collection
```js
collection.filters.get('createdAt.after')
// undefined
```
`performAction` does not merge filters, so this was not being set
In this case, I just worked around it by using updateFilters. Since I don't need anything else on performAction, then the above call is equal to the following:
```js
updateFilters({filters: {'createdAt.after': 'yesterday'}})
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the collection.performAction('list', ...) call and compare it with updateFilters using the example in the issue. Trace how the filters option is handled and confirm what collection.filters.get('createdAt.after') should return after the action; done means the intended filter behavior is covered and the existing use case remains valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100