Closed ahoym closed 6 years ago
Code Climate has analyzed commit 6951d6cf and detected 3 issues on this pull request.
Here's the issue category breakdown:
Category | Count |
---|---|
Duplication | 3 |
The test coverage on the diff in this pull request is 96.9% (50% is the threshold).
This pull request will bring the total coverage in the repository to 97.4% (0.1% change).
View more on Code Climate.
okay codeclimate, that's enough now
Context
If we have a consistent namespace within a
resource
where we store data entities (entitiesPath
), and we consistently know where properties are going to be set, updated, or removed, then we can dynamically create selectors that traverse the structures that our reducers consistently output.As an example, we actually use the
makeResourceReducer
function in our tests, use the sameresource
andentitiesPath
for both reducer and selector factories, and are able to use the selectors on the output state from thefooReducer
.This is valuable as selectors traverse the exact states that reducers output, so by that relationship they have to be coupled. This allows data providers to only interface with selectors, which completely isolates the view from needing to know what the structure of the store looks like.
Note for the future, this can probably be its own package if consumers do not want to use selectors.
Additional Changes
reselect
,lodash.camelcase
,lodash.capitalize
, and their respective@types
files.makeResourceReducer
to be more usableTasks