Skip to content

Commit eff7b85

Browse files
authored
Update store.md
1 parent f42e510 commit eff7b85

File tree

1 file changed

+2
-4
lines changed
  • 15/umbraco-cms/customizing/foundation/working-with-data

1 file changed

+2
-4
lines changed

15/umbraco-cms/customizing/foundation/working-with-data/store.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,9 @@ class MyImplementation extends UmbLitElement {
5454
}
5555

5656
private _observeAllProducts() {
57-
if (!this._myProductStore) return;
5857

5958
// Notice this callback will be triggered initially and each time the products change:
60-
this.observe(this._myProductStore.products, (products) => {
59+
this.observe(this._myProductStore?.products, (products) => {
6160
console.log('The data of all products is:', products);
6261
});
6362
}
@@ -108,10 +107,9 @@ class MyImplementation extends UmbLitElement {
108107
}
109108

110109
private _observeASpecificProduct() {
111-
if (!this._myProductStore) return;
112110

113111
// Notice this callback will be triggered initially and each time the specific product change:
114-
this.observe(this._myProductStore.getByKey('1234'), (product) => {
112+
this.observe(this._myProductStore?.getByKey('1234'), (product) => {
115113
console.log('The data of product `1234`` is:', product);
116114
});
117115
}

0 commit comments

Comments
 (0)