-
Notifications
You must be signed in to change notification settings - Fork 73
Firestore document preview and basic-editing #35
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
Conversation
|
Please kindly rebase this. |
yuchenshi
left a comment
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.
LGTM in general, will take another pass and run this locally next Monday.
tstirrat
left a comment
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.
Looking good
|
This is awesome btw. So much happening here and such a concise and clear PR. Very easy to grok. I saw the number of commits and general size and thought "oh lord.. better get a beer".. but it really was super easy to follow. |
| produce((draft, { payload }) => { | ||
| const parent = get(draft, getParentPath(payload.path)) || draft; | ||
| if (isMap(parent)) { | ||
| parent[last(payload.path) as string] = payload.value; |
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.
I think last<string>() is more safe, because it will check the type of the input array, vs cast the result.
Breaking this up into smaller bits... this includes:
Note on structure, reducer function is shared between Field and Editor, but they each have their own Provided reducer instance. In effect: Field will generally exist within the whole document, while Editor will only have its state initialized to the selected Field's value.
Still to come: