-
Notifications
You must be signed in to change notification settings - Fork 139
Firestore #327
base: firestore
Are you sure you want to change the base?
Firestore #327
Changes from 2 commits
844dcfd
5274aeb
91d7793
15f1c8a
f6df335
f107307
f6b0b14
58ed184
c8e301c
ac153f4
ab634d9
7290611
a7e445e
6ca00b6
ba6a8e8
7ea2df2
7ff8a37
a3f9653
63cbcaa
fd337f1
24e2d64
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -169,10 +169,11 @@ | |
|
|
||
| this._firestoreProps = {}; | ||
| this._firestoreListeners = {}; | ||
| this.db = this.constructor.db || firebase.firestore(); | ||
| } | ||
|
|
||
| connectedCallback() { | ||
| super.connectedCallback(); | ||
| this.db = this.constructor.db || firebase.firestore(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we ever have
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Doesn't seem so...copy pasta.
Yes a
I'm not quite sure I follow. |
||
| if (this[CONNECTED_CALLBACK_TOKEN] !== true) { | ||
| this[CONNECTED_CALLBACK_TOKEN] = true; | ||
|
|
||
|
|
@@ -188,8 +189,6 @@ | |
| } | ||
| } | ||
| } | ||
|
|
||
| super.connectedCallback(); | ||
| } | ||
|
|
||
| _firestoreBind(name, options) { | ||
|
|
@@ -211,9 +210,9 @@ | |
| const observer = | ||
| `_firestoreUpdateBinding('${name}', ${args.join(',')})` | ||
| this._createMethodObserver(observer); | ||
| } else { | ||
| this._firestoreUpdateBinding(name, ...args.map(x => this[x])); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are two issues here:
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I can see how this might be an issue, but I'm not sure that the timing requisite of such a reality is possible with the code order of a Polymer component. Can you point me to how you envisioned that being possible?
Good point, I can clean that up when you think this is going towards a solution. |
||
| } | ||
|
|
||
| this._firestoreUpdateBinding(name, ...args.map(x => this[x])); | ||
| } | ||
|
|
||
| _firestoreUpdateBinding(name, ...args) { | ||
|
|
||
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.
May I ask why did you decide to move it here? What’s the reasoning behind it?
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 mainly stole these two lines from #279, but the goal is to not have an issue like this: https://receptive-kitten.glitch.me/ I can look into what this is actually fixing soon.
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.
Is it actually needed to fix it? I can’t really see why would it help.
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.
Ok, finally got into this part more. It helps because if you allow
super.connectedCallback()to run, then the code at https://github.com/firebase/polymerfire/blob/master/firebase-app.html#L123 will also be allowed to fully run, which means that the app will have actually connected to Firebase. It's possible that you suggestions on moving some of thethis.dbstuff out to the scope might address this as well. However, were that not so, maybe this is a use case for https://www.polymer-project.org/2.0/docs/api/namespaces/Polymer.RenderStatus#function-Polymer.RenderStatus.afterNextRender ?