| 69 | } |
| 70 | |
| 71 | const resolveEnabled = <I>( |
| 72 | arg: I | WatchSource<I> | undefined | WatchSource<Option.Option<I>>, |
| 73 | options: { |
| 74 | readonly mode?: "optional" | undefined |
| 75 | readonly enabled?: MaybeRefOrGetter<boolean | undefined> | undefined |
| 76 | } | undefined |
| 77 | ) => { |
| 78 | if (options?.mode === "optional") { |
| 79 | return computed(() => { |
| 80 | const option = toValue(arg) |
| 81 | return Option.isSome(option) |
| 82 | }) |
| 83 | } |
| 84 | return computed(() => { |
| 85 | const enabled = options?.enabled |
| 86 | if (enabled === undefined) return true |
| 87 | return !!toValue(enabled) |
| 88 | }) |
| 89 | } |
| 90 | |
| 91 | type LegacyTanstackOptions<A, E, TData> = |
| 92 | & ( |