21 lines
399 B
TypeScript
21 lines
399 B
TypeScript
export const useAppStore = defineStore("app", {
|
|
state: () => ({
|
|
booted: false,
|
|
_color: { col: 0, row: 0 },
|
|
}),
|
|
|
|
actions: {
|
|
setColor(col: number, row: number) {
|
|
this._color = { col, row };
|
|
},
|
|
},
|
|
|
|
getters: {
|
|
color: (state) => ({
|
|
col: state._color.col,
|
|
row: state._color.row,
|
|
hex: APP_COLORS[state._color.row]![state._color.col]!,
|
|
}),
|
|
},
|
|
});
|