Refactor to add readonly interfaces

Using more granular interfaces adds to expressiveness of the code.
Knowing what needs to mutate the state explicitly helps easier
understanding of the code and therefore increases the maintainability.
This commit is contained in:
undergroundwires
2021-12-24 21:14:27 +01:00
parent a1871a2982
commit c3c5b897f3
16 changed files with 58 additions and 42 deletions

View File

@@ -13,7 +13,7 @@
import { Component } from 'vue-property-decorator';
import { OperatingSystem } from '@/domain/OperatingSystem';
import { StatefulVue } from '@/presentation/components/Shared/StatefulVue';
import { ICategoryCollectionState } from '@/application/Context/State/ICategoryCollectionState';
import { IReadOnlyCategoryCollectionState } from '@/application/Context/State/ICategoryCollectionState';
import { ApplicationFactory } from '@/application/ApplicationFactory';
import MenuOptionList from './MenuOptionList.vue';
import MenuOptionListItem from './MenuOptionListItem.vue';
@@ -38,7 +38,7 @@ export default class TheOsChanger extends StatefulVue {
context.changeContext(newOs);
}
protected handleCollectionState(newState: ICategoryCollectionState): void {
protected handleCollectionState(newState: IReadOnlyCategoryCollectionState): void {
this.currentOs = newState.os;
this.$forceUpdate(); // v-bind:class is not updated otherwise
}