1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-06-28 16:48:00 +02:00
blog/src/stores/fetcher.ts
Matthias Kretschmann 3b25ae2282
Location fetching (#843)
* location component

* fetching with @nanostores/query

* layouts reorg

* typescript plugins cleanup

* location component unit test cases

* fetch only when visible
2023-10-04 14:45:54 +01:00

7 lines
210 B
TypeScript

import { nanoquery } from '@nanostores/query'
export const [createFetcherStore, createMutatorStore] = nanoquery({
fetcher: (...keys: (string | number)[]) =>
fetch(keys.join('')).then((r) => r.json())
})