-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entities loading #748
Merged
Merged
Entities loading #748
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
With this creator functions action types, actions functions and the loader function can be created for an entity type. This will result in less copy and paste code in future.
The moved modules contain helper functions/classes for the to be created entities actions and selectors. Therefore use a more obvious directory scheme.
Export the actions as an object with action creator functions.
This function creates a generic entities reducer.
The other cases are already tested in detail for createReducer. Therefore simplify filterReducer tests to only check the basic functionality
Now by using generic functions to create entities actions, reducers and selectors there is no need for having different js modules for each of them. Therefore merge all filter modules into one single module.
Always convert name parameter to uppercase letters.
Don't export EntitiesSelector class and consider it as an implementation detail. Provide a createSelector instead. This allows to change the layout of the reducers more easily without having to touch all entities selectors.
Accept name instead of a promise function. Currently all load functions will call gmp[name].getAll. Therefore the createLoadFunc can be simplified.
Use more generalized names selector, reducer and load.
This function creates all redux related functions and objects in one go. Namely load, selector, actions, types and reducer.
Codecov Report
@@ Coverage Diff @@
## master #748 +/- ##
=========================================
+ Coverage 5.61% 5.69% +0.07%
=========================================
Files 775 776 +1
Lines 25671 25680 +9
Branches 5794 5806 +12
=========================================
+ Hits 1442 1462 +20
+ Misses 21764 21755 -9
+ Partials 2465 2463 -2
Continue to review full report at Codecov.
|
swaterkamp
approved these changes
Jun 26, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Update and simplify the entities loading into the redux store.