Closed s-shiva1995 closed 6 years ago
Hey @s-shiva1995 , thanks so much for the contribution, it looks great!
I was wondering if there was a good alternative to using typeof
on the same level as actual members inside of an object. It mixes metaphors, which is confusing, and also will conflict in the potential situation where an object contains an actual member named typeof
. Potentially objects could use value
similar to basic types where value
would contain all of its members.
Also, this is more my personal taste, but I feel typeof
more Javascript than Firestore, how do you feel about just calling the member type
?
Finally I was wondering why you store members of an array as object rather than in an array?
I've created a new branch starting with your PR: s-shiva1995-patch-18
It includes organization inspired by the functionality you added as well as Flow coverage of the new code. If you don't mind I'd like to use this as the continuation point!
Sure, well typeof
or type
both describe one and the same thing, but type
keyword suits better.
About storing array also as object, I did this to simplify restoring code. So that I can check which type
of data is available in object and simply run the function to restore it accordingly.
Gotcha! Ah you've already done work on the restore functionality, that's awesome 👍
I sent you a PR with these changes, if it looks good updated your PR here and I'll merge it in!
Ah thanks for catching those places I missed. I'd be good to have Flow coverage of that portion at some point. I'm going to spend a little trying to improve the CODEBEAT score and then merge it!
I'm going to merge this with the additional changes I pushed back at you unless there's anything else you'd like to get in!
This can handle basic datatypes supported by firestore and reference now returns the path of references document from root collection with typeof as reference.