1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-06-30 13:41:54 +02:00
blog/src/stores/location.ts

25 lines
464 B
TypeScript
Raw Normal View History

import { createFetcherStore } from './fetcher'
export type Location = {
country: string
city: string
country_code: string
date_start: string
date_end: string
}
export type LocationStore =
| {
now: Location
next: Location
previous: Location
}
| undefined
const url = 'https://location.kremalicious.com'
export const $location = createFetcherStore<LocationStore>([url], {
refetchOnReconnect: true,
refetchOnFocus: true
})