Skip to content

Commit

Permalink
fix: compatible with new _addSignalListener signal mixin (#954)
Browse files Browse the repository at this point in the history
  • Loading branch information
alimd authored Mar 17, 2023
2 parents 914f471 + e2be863 commit a92db9f
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion ui/element/src/mixins/direction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function DirectionMixin<T extends Constructor<SignalMixinInterface>>(

override connectedCallback(): void {
super.connectedCallback();
this._signalListenerList.push(localeContextConsumer.subscribe(() => this._updateDir()));
this._addSignalListener(localeContextConsumer.subscribe(() => this._updateDir()));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion ui/element/src/mixins/localize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function LocalizeMixin<T extends Constructor<SignalMixinInterface>>(
class LocalizeMixinClass extends superClass {
override connectedCallback(): void {
super.connectedCallback();
this._signalListenerList.push(
this._addSignalListener(
l18eContextConsumer.subscribe(this._l18eContextUpdated.bind(this)),
);
}
Expand Down
2 changes: 1 addition & 1 deletion ui/element/src/mixins/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function RouterMixin<T extends Constructor<SignalMixinInterface>>(
class RouterMixinClass extends superClass {
override connectedCallback(): void {
super.connectedCallback();
this._signalListenerList.push(
this._addSignalListener(
routeContextConsumer.subscribe((routeContext) => this._routeContextUpdated(routeContext), {
receivePrevious: 'No',
}),
Expand Down
2 changes: 1 addition & 1 deletion ui/pwa-helper/src/pwa-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class AlwatrPwaElement extends RouterMixin(SignalMixin(UnresolvedMixin(Al
if (!localeContextConsumer.getValue()) {
setLocale();
}
this._signalListenerList.push(
this._addSignalListener(
commandHandler.define<{smooth?: boolean}, undefined>(scrollToTopCommand.id, (option): undefined => {
this.renderRoot.querySelector('.scroll-area')?.scrollTo({
top: 0,
Expand Down
2 changes: 1 addition & 1 deletion ui/ui-kit/src/top-app-bar/top-app-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export class AlwatrTopAppBar extends LocalizeMixin(DirectionMixin(SignalMixin(Al
super.connectedCallback();
const contextSignal = this.getAttribute('context-signal');
if (contextSignal) {
this._signalListenerList.push(
this._addSignalListener(
contextConsumer.subscribe<TopAppBarContent>(contextSignal, (context) => {
this.content = {
type: 'small',
Expand Down
2 changes: 1 addition & 1 deletion uniquely/com-pwa/src/ui/page/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class AlwatrPageHome extends UnresolvedMixin(SignalMixin(AlwatrBaseElemen
override connectedCallback(): void {
super.connectedCallback();

this._signalListenerList.push(
this._addSignalListener(
homePageContentContextConsumer.subscribe((content) => {
this.content = content;
topAppBarContextProvider.setValue(content.topAppBar);
Expand Down
8 changes: 4 additions & 4 deletions uniquely/com-pwa/src/ui/page/new-order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export class AlwatrPageNewOrder extends UnresolvedMixin(AlwatrOrderDetailBase) {
override connectedCallback(): void {
super.connectedCallback();

this._signalListenerList.push(
this._addSignalListener(
productStorageContextConsumer.subscribe(
(context) => {
this._stateMachine.transition(`context_request_${context.state}`, {productStorage: context.content});
Expand All @@ -369,7 +369,7 @@ export class AlwatrPageNewOrder extends UnresolvedMixin(AlwatrOrderDetailBase) {
),
);

this._signalListenerList.push(
this._addSignalListener(
productPriceStorageContextProvider.subscribe(
(context) => {
this._stateMachine.transition(`context_request_${context.state}`, {priceStorage: context.content});
Expand All @@ -378,7 +378,7 @@ export class AlwatrPageNewOrder extends UnresolvedMixin(AlwatrOrderDetailBase) {
),
);

this._signalListenerList.push(
this._addSignalListener(
finalProductPriceStorageContextProvider.subscribe(
(context) => {
this._stateMachine.transition(`context_request_${context.state}`, {finalPriceStorage: context.content});
Expand All @@ -387,7 +387,7 @@ export class AlwatrPageNewOrder extends UnresolvedMixin(AlwatrOrderDetailBase) {
),
);

this._signalListenerList.push(
this._addSignalListener(
finalProductPriceStorageContextProvider.subscribe(
(context) => {
this._stateMachine.transition(`context_request_${context.state}`, {finalPriceStorage: context.content});
Expand Down
4 changes: 2 additions & 2 deletions uniquely/com-pwa/src/ui/page/order-detail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export class AlwatrPageOrderDetail extends UnresolvedMixin(AlwatrOrderDetailBase
override connectedCallback(): void {
super.connectedCallback();

this._signalListenerList.push(
this._addSignalListener(
orderStorageContextConsumer.subscribe(
(context) => {
this._stateMachine.transition(`context_request_${context.state}`, {orderStorage: context.content});
Expand All @@ -189,7 +189,7 @@ export class AlwatrPageOrderDetail extends UnresolvedMixin(AlwatrOrderDetailBase
),
);

this._signalListenerList.push(
this._addSignalListener(
productStorageContextConsumer.subscribe(
(context) => {
this._stateMachine.transition(`context_request_${context.state}`, {productStorage: context.content});
Expand Down
4 changes: 2 additions & 2 deletions uniquely/com-pwa/src/ui/page/order-tracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ export class AlwatrPageOrderDetail extends UnresolvedMixin(AlwatrOrderDetailBase
override connectedCallback(): void {
super.connectedCallback();

this._signalListenerList.push(
this._addSignalListener(
orderStorageContextConsumer.subscribe((context) => {
this._stateMachine.transition(`context_request_${context.state}`, {orderStorage: context.content});
}, {receivePrevious: 'NextCycle'}),
);

this._signalListenerList.push(
this._addSignalListener(
productStorageContextConsumer.subscribe((context) => {
this._stateMachine.transition(`context_request_${context.state}`, {productStorage: context.content});
}, {receivePrevious: 'NextCycle'}),
Expand Down
2 changes: 1 addition & 1 deletion uniquely/soffit-pwa/src/page-home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class AlwatrPageHome extends SignalMixin(AlwatrBaseElement) {
override connectedCallback(): void {
super.connectedCallback();

this._signalListenerList.push(
this._addSignalListener(
homePageContentContextConsumer.subscribe((content) => {
this.content = content;
topAppBarContextProvider.setValue(content.topAppBar);
Expand Down
2 changes: 1 addition & 1 deletion uniquely/soffit-pwa/src/page-product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class AlwatrPageHome extends SignalMixin(AlwatrBaseElement) {
override connectedCallback(): void {
super.connectedCallback();

this._signalListenerList.push(
this._addSignalListener(
productPageContentContextConsumer.subscribe((content) => {
this.content = content;
topAppBarContextProvider.setValue(content.topAppBar);
Expand Down

0 comments on commit a92db9f

Please sign in to comment.