-
-
Notifications
You must be signed in to change notification settings - Fork 553
Add getValueAt function for easy migration to v2 from dataToJS and pathToJS #305
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 getValueAt function for easy migration to v2 from dataToJS and pathToJS #305
Conversation
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.
Just one small change, but other than that, looks great.
Really nice comments 🥇
src/helpers.js
Outdated
| } | ||
|
|
||
| const dotPath = getDotStrPath(path) | ||
| const valueAtPath = get(firebase, dotPath) |
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.
We should also have the notSetValue be passed here so it is used as the defaultValue:
return get(firebase, dotPath, notSetValue)* feat(core): `recompose` used for `withFirebase` and `withFirestore` HOCs * feat(core): `promiseEvents` method added. Similar to `firebaseConnect`, but not a React Higher Order Component - #299 - thanks @marekolszewski * feat(core): `redux-firestore` is no longer included and is now an optionalDependency (increased bundle size too much) * feat(helpers): `getVal` added to simplify migration from v1 to v2 (can easily replace `dataToJS`) - #305 - thanks @fej-snikduj * feat(reducer): added error to clearly indicate wrong initial state being passed to `errors` state * feat(reducer): `preserve` now supports passing an object to preserve `auth`, `profile`, `errors`, and `ordered` * feat(docs): Firestore setup instructions switched to using `redux-firestore` externally * feat(examples): firestore example uses `redux-firestore` directly (since it is no longer included) * fix(typings): remove an artifact from a previous merge conflict - #304 - thanks @cbellino * fix(reducer): `authError` state is now `null` by default (tests changed to match) * fix(examples): examples all point to `next` tag for consistency * fix(examples): snippets README.md files updated * fix(examples): `tests` folder removed from material example ### Potentially Breaking * `authError` state is now `null` by default instead of `{}` - this is more clear, and more closely resembles `v1.*.*`
* Migration guide updated with info about auth state and `getVal` - #305
* fix(reducers): add `EMPTY_AUTH_CHANGE` case to Profile Reducer - #305 * feat(constants): `enableEmptyAuthChanges` config option replaced by `preserveOnEmptyAuthChange` - #305 * feat(profile): `autoPopulateProfile` support for v2 (still `disabled` by default) * fix(presence): support presence option on `react-native-firebase` versions without `setPriority` on `RNFirebase.database.ThenableReference` - #267 * fix(core): withFirebase now works for all main methods * feat(examples): material example updated to be much more simple (uses mostly functional components over classes) * feat(docs): `promiseEvents` added to SSR docs - #299
Description
Check List
If not relevant to pull request, check off as complete
Relevant Issues