File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
15/umbraco-cms/customizing/foundation/working-with-data Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments