mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-04-24 10:31:09 +08:00
21 lines
410 B
TypeScript
21 lines
410 B
TypeScript
import { appStatus } from '../api/program';
|
|
|
|
export const programStore = defineStore('program', () => {
|
|
const status = ref(false);
|
|
const timer = ref<NodeJS.Timer | null>(null);
|
|
|
|
const getStatus = async () => {
|
|
status.value = await appStatus();
|
|
};
|
|
|
|
const onUpdate = () => {
|
|
timer.value = setInterval(() => getStatus(), 3000);
|
|
};
|
|
|
|
return {
|
|
status,
|
|
getStatus,
|
|
onUpdate,
|
|
};
|
|
});
|