Open History to see the last commit
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 }
12}
13β
14export function snapshot<T>(value: T) {
15 return $state.snapshot(value)
16}
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'])