better
This commit is contained in:
parent
5eab39f1c3
commit
a839d87ee6
@ -22,8 +22,8 @@ export const useWizardStore = defineStore('wizard', () => {
|
|||||||
localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(specs));
|
localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(specs));
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
function updateSpec(fieldName: keyof Specs, newValue: SpecValue) {
|
function updateSpec<K extends keyof Specs>(fieldName: K, newValue: Specs[K]) {
|
||||||
(specs as Record<keyof Specs, SpecValue>)[fieldName] = newValue;
|
specs[fieldName] = newValue;
|
||||||
updateLocalStorage();
|
updateLocalStorage();
|
||||||
}
|
}
|
||||||
function updateSpecs(newValue: Specs) {
|
function updateSpecs(newValue: Specs) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user