You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
472 B
25 lines
472 B
import { versionedStoreBuilder } from "@/utils/storage"; |
|
|
|
export const volumeStore = versionedStoreBuilder() |
|
.setKey("mw-volume") |
|
.addVersion({ |
|
version: 0, |
|
create() { |
|
return { |
|
volume: 1, |
|
}; |
|
}, |
|
}) |
|
.build(); |
|
|
|
export function getStoredVolume(): number { |
|
const store = volumeStore.get(); |
|
return store.volume; |
|
} |
|
|
|
export function setStoredVolume(volume: number) { |
|
const store = volumeStore.get(); |
|
store.save({ |
|
volume, |
|
}); |
|
}
|
|
|