-
-
Notifications
You must be signed in to change notification settings - Fork 345
Added custom createSnapshot support #291
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
…dated recently I've put "o is Date"
… obj reference creation
Oh cool ! I should be able to give it a look in 2 weeks |
How can I do Vue.use using Vue.extend? I tried to use the same instance, but the first test alters the custom binding name, so I thought it would be better to scope each Global API for each test. It's just a devDependency anyway. |
Scoping is a good idea, but if we can avoid keeping a dependency up to date, that's easier to maintain Something like this should do const LocalVue = Vue.extend({})
LocalVue.use(...) |
Codecov Report
@@ Coverage Diff @@
## master #291 +/- ##
==========================================
+ Coverage 99.67% 99.67% +<.01%
==========================================
Files 9 9
Lines 308 312 +4
Branches 53 54 +1
==========================================
+ Hits 307 311 +4
Misses 1 1
Continue to review full report at Codecov.
|
@posva done |
packages/vuefire/src/index.js
Outdated
@@ -41,11 +41,13 @@ function bind ({ vm, key, ref, ops }, options) { | |||
|
|||
export function firestorePlugin ( | |||
Vue, | |||
{ bindName = '$bind', unbindName = '$unbind' } = {} | |||
{ bindName = '$bind', unbindName = '$unbind', createSnapshot } = {} |
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'm not sure about the naming because a snapshot has a particular meaning in Firestore, so let's try to find other alternatives. Maybe serializeSnapshot
?
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.
maybe something with populate
would be nice, since it's gonna get the firestore data and populate the vm.
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 missed this message, sorry :(
I think we should emphasize on the fact that it transforms the data coming from Firebase before we set it on the instance, that's why I think the verb should be related to that with something like serialize or serializer
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 add the typings for vuefire
@posva Added typings for createSnapshot |
Should #302 close this PR? |
Yes, let's close this in favor of #302 |
Hey! Here's my implementation of the custom createSnapshot func.
After 2 hours I got it working.
closes #240
I hope it's a good implementation, but if not just tell me a better one in the PR review.