I have two seperate issues here.
let's start with my enum:
export enum TableViewTypes {
user = 'users',
pitching = 'pithcing',
milestones = 'milestones',
mediaList = 'mediaList',
contacts = 'contacts'
}
in my service i have a method, i need to use the tableType
argument as the key when reassigning a value using the spread operator...
storeTableView(tableType: TableViewTypes, value: boolean) {
this.storageService.userPreferences = {
...this.storageService.userPreferences,
tableView: {
...this.storageService.userPreferences.tableView,
/* tableType??? */: value
}
};
}
Not sure what the correct thing to do here is while maintaing my type checking. The value of this.storageService.userPreferences.tableView
has a type interface of...
export interface TableViewModel {
users: boolean;
pitching: boolean;
milestones: boolean;
mediaList: boolean;
contacts: boolean;
}