-
Notifications
You must be signed in to change notification settings - Fork 61
Add support for nested grid reducers #106
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
Add support for nested grid reducers #106
Conversation
reducerKeys now could be string that means that root grid reducers is on the state[reducersKeys] position in app state
Codecov Report
@@ Coverage Diff @@
## master #106 +/- ##
==========================================
- Coverage 77.19% 77.15% -0.04%
==========================================
Files 112 112
Lines 2727 2732 +5
Branches 280 270 -10
==========================================
+ Hits 2105 2108 +3
- Misses 412 416 +4
+ Partials 210 208 -2
Continue to review full report at Codecov.
|
Thanks for the PR for #95! Could you give a brief description of how this changes the API for grid? Could you provide examples of how you would instantiate grid -- and does it still work both ways? This version still works, correct? import { combineReducers } from 'redux';
import { Reducers as gridReducers } from 'react-redux-grid';
import myAppReducer from './customReducers/app';
import myDataReducer from './customReducers/data';
export const rootReducer = combineReducers({
myAppReducer,
myDataReducer,
...gridReducers
}); How do you envision people using this new method? |
src/util/stateGetter.js
Outdated
&& props.reducerKeys[key]) { | ||
if (props && props.reducerKeys) { | ||
if (typeof props.reducerKeys === 'string' && | ||
props.reducerKeys.length > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if reducerKeys
is of type string
and it's defined, won't it have a length
> 0? Seems like even if you pass the reducerKey of grid
, this check would return false?
Added example to the docs Removed redundant check
New changes look good. I will test this out tonight. Thanks! |
Changes look good, tests look good, and I've verified it works locally. Would you mind squashing your two commits into one? Great PR! |
@bencripps As I know github have added squash on merge for pull request, aren't they? |
That's an awesome feature I didn't know about! Squashed & merged! |
* Add support for nested grid reducers * Added example to the docs
reducerKeys now could be string that means
that root grid reducers is on the state[reducersKeys]
position in app state