Skip to content

Commit

Permalink
fix pendin event notification
Browse files Browse the repository at this point in the history
  • Loading branch information
3ch023 committed Dec 17, 2024
1 parent d543279 commit 43475cf
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 27 deletions.
4 changes: 2 additions & 2 deletions libs/deps/mas/commerce.js

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions libs/deps/mas/mas.js

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions libs/features/mas/dist/mas.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion libs/features/mas/src/mas-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ export class MasElement {
this.state = STATE_FAILED;
this.update();
this.log?.error('Failed:', { element: this.wrapperElement, error });
// Allow calling code to perform sync updates of this element
// before notifying observers about state change
setImmediate(() => this.notify());
return true;
}
Expand All @@ -166,7 +168,8 @@ export class MasElement {
if (options) this.options = options;
this.state = STATE_PENDING;
this.update();
setImmediate(() => this.notify());
// immediately notify observers about state change
this.notify();
return this.version;
}

Expand Down

0 comments on commit 43475cf

Please sign in to comment.