Skip to content

Commit

Permalink
docs(collection-field): clarify why listening to store (#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
redgeoff authored Oct 9, 2021
1 parent 5e63d8c commit 3e2bf14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/fields/collection-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ export default class CollectionField extends Field {
// the typeof check to ensure that an empty RecordList doesn't bomb out when
// newStore='{{store}}'?
if (newStore && typeof newStore !== 'string') {
// Listen to changes to the store so that we can do things like display real time changes
// made by other users
newStore.on('$change', this._handleStoreChangeFactory());
}

Expand Down
2 changes: 1 addition & 1 deletion src/stores/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export default class Store extends UIComponent {
}

_now() {
// We use a DateField to avoid Firestore's automatic conversion of Date's to Firebase style
// We use a DateField to avoid Firestore's automatic conversion of Dates to Firebase style
// timestamps.
const date = new DateField({ now: true });
return date.getValue();
Expand Down

0 comments on commit 3e2bf14

Please sign in to comment.