Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

stores.svelte.ts

25 lines542 Bytes

1export function ref<T>(initial: T) {
2 let value = $state(initial)
3​
4 return {
5 get value() {
6 return value
7 },
8 set value(newValue) {
9 value = newValue
10 },
11 }
13​
14export function snapshot<T>(value: T) {
15 return $state.snapshot(value)
17​
18export const staleTime = ref(1000)
19export const gcTime = ref(3000)
20export const errorRate = ref(0.05)
21export const queryTimeMin = ref(1000)
22export const queryTimeMax = ref(2000)
23​
24export const editingIndex = ref<number | null>(null)
25export const views = ref(['', 'fruit', 'grape'])