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

utils.ts

8 lines251 Bytes

1import type { Writable } from 'svelte/store'
2import type { WritableOrVal } from './types'
3​
4export function isWritable<T extends object>(
5 obj: WritableOrVal<T>,
6): obj is Writable<T> {
7 return 'subscribe' in obj && 'set' in obj && 'update' in obj
8}