mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-16 05:09:57 +00:00
20 lines
414 B
TypeScript
20 lines
414 B
TypeScript
import { readable } from "svelte/store";
|
|
import type { Optional } from "./types/generic";
|
|
|
|
type VersionResponse = {
|
|
commit: string;
|
|
branch: string;
|
|
remote: string;
|
|
version: string;
|
|
}
|
|
|
|
export const version = readable<Optional<VersionResponse>>(
|
|
undefined,
|
|
(set) => {
|
|
fetch('/version.json')
|
|
.then(r => r.json())
|
|
.then(set)
|
|
.catch(() => {})
|
|
}
|
|
)
|