-
-
Notifications
You must be signed in to change notification settings - Fork 553
Population of profile params #123
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
Population of profile params #123
Conversation
Codecov Report
@@ Coverage Diff @@
## master #123 +/- ##
==========================================
- Coverage 88.81% 87.01% -1.81%
==========================================
Files 17 17
Lines 1368 1417 +49
Branches 225 233 +8
==========================================
+ Hits 1215 1233 +18
- Misses 153 184 +31 |
| "build:umd:min": "cross-env BABEL_ENV=commonjs NODE_ENV=production webpack src/index.js dist/react-redux-firebase.min.js", | ||
| "build": "npm run build:commonjs && npm run build:es && npm run build:umd && npm run build:umd:min", | ||
| "watch": "npm run build:commonjs -- --watch", | ||
| "watch": "npm run build:umd -- --watch", |
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.
Nice. This is the more often use-case since most are requiring and using Webpack or some other bundler that points to the UMD version.
| const profile = snap.val() | ||
| forEach(populates, (p) => { | ||
| set(profile, p.child, get(data, `${p.root}.${snap.val()[p.child]}`)) | ||
| const child = get(profile, p.child) |
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.
Nice use of get here, this will keep it so that dot notation can be used for child parameter of populate objects.
| /** | ||
| * @private | ||
| * @description Determine the structure of the child parameter to populate onto | ||
| * @param {String|Object} child - Value at child parameter |
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.
This is great for now, but eventually we might want to make this more general (return type of all types of vars) to be used elsewhere. Wish there was a lodash function to just return a variable's type but it seems like they feel as though developers should make this themselves.
Description
Non-breaking small feature addition to profile parameter population. Profile population will now work on a list of UIDs, key:value pairs, and a single UID (which was already supported).
Check List