Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSC cl/683332949 - Move initializers into constructors. #6927

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,23 @@ import {State} from './store/debugger_types';
],
})
export class DebuggerContainer implements OnInit, OnDestroy {
readonly runs$ = this.store.pipe(select(getDebuggerRunListing));
readonly runs$;

readonly runsIds$ = this.store.pipe(
select(
createSelector(getDebuggerRunListing, (runs): string[] =>
Object.keys(runs)
)
)
);
readonly runsIds$;

readonly activeRunId$ = this.store.pipe(select(getActiveRunId));
readonly activeRunId$;

constructor(private readonly store: Store<State>) {}
constructor(private readonly store: Store<State>) {
this.runs$ = this.store.pipe(select(getDebuggerRunListing));
this.runsIds$ = this.store.pipe(
select(
createSelector(getDebuggerRunListing, (runs): string[] =>
Object.keys(runs)
)
)
);
this.activeRunId$ = this.store.pipe(select(getActiveRunId));
}

ngOnInit(): void {
this.store.dispatch(debuggerLoaded());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,31 @@ const ALERT_TYPE_TO_DISPLAY_NAME_AND_SYMBOL: {
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AlertsContainer {
readonly numAlerts$ = this.store.pipe(select(getNumAlerts));
readonly numAlerts$;

readonly alertsBreakdown$ = this.store.pipe(
select(
createSelector(getAlertsBreakdown, (alertsBreakdown) => {
const alertTypes = Object.keys(alertsBreakdown);
alertTypes.sort();
return alertTypes.map((alertType): AlertTypeDisplay => {
return {
type: alertType as AlertType,
...ALERT_TYPE_TO_DISPLAY_NAME_AND_SYMBOL[alertType],
count: alertsBreakdown[alertType],
};
});
})
)
);
readonly alertsBreakdown$;

readonly focusType$ = this.store.pipe(select(getAlertsFocusType));
readonly focusType$;

constructor(private readonly store: Store<State>) {}
constructor(private readonly store: Store<State>) {
this.numAlerts$ = this.store.pipe(select(getNumAlerts));
this.alertsBreakdown$ = this.store.pipe(
select(
createSelector(getAlertsBreakdown, (alertsBreakdown) => {
const alertTypes = Object.keys(alertsBreakdown);
alertTypes.sort();
return alertTypes.map((alertType): AlertTypeDisplay => {
return {
type: alertType as AlertType,
...ALERT_TYPE_TO_DISPLAY_NAME_AND_SYMBOL[alertType],
count: alertsBreakdown[alertType],
};
});
})
)
);
this.focusType$ = this.store.pipe(select(getAlertsFocusType));
}

onToggleFocusType(alertType: AlertType) {
this.store.dispatch(alertTypeFocusToggled({alertType}));
Expand Down
Loading
Loading