25 lines
565 B
TypeScript
25 lines
565 B
TypeScript
import { defineStore } from "pinia";
|
|
import Updater from "updaterweblibrary";
|
|
|
|
|
|
const useArchiveStore = defineStore("archive", {
|
|
state: () => (
|
|
{updater: new Updater()}
|
|
),
|
|
getters: {
|
|
getUrl(): string {
|
|
return this.updater.archiveURL;
|
|
}
|
|
},
|
|
actions: {
|
|
setUrl(value: string): void {
|
|
this.updater = new Updater(value, "rss");
|
|
},
|
|
async testArchive(): Promise<void> {
|
|
console.log(await this.updater.getArchive());
|
|
}
|
|
}
|
|
});
|
|
|
|
export default useArchiveStore;
|