()
| 156 | // noop |
| 157 | } |
| 158 | const run = () => { |
| 159 | if (defaultedOptions.value.enabled !== false) { |
| 160 | // fix #6133 |
| 161 | observer.setOptions(defaultedOptions.value) |
| 162 | const optimisticResult = observer.getOptimisticResult( |
| 163 | defaultedOptions.value, |
| 164 | ) |
| 165 | if (optimisticResult.isStale) { |
| 166 | stopWatch() |
| 167 | observer |
| 168 | .fetchOptimistic(defaultedOptions.value) |
| 169 | .then(resolve, (error: TError) => { |
| 170 | if ( |
| 171 | shouldThrowError(defaultedOptions.value.throwOnError, [ |
| 172 | error, |
| 173 | observer.getCurrentQuery(), |
| 174 | ]) |
| 175 | ) { |
| 176 | reject(error) |
| 177 | } else { |
| 178 | resolve(observer.getCurrentResult()) |
| 179 | } |
| 180 | }) |
| 181 | } else { |
| 182 | stopWatch() |
| 183 | resolve(optimisticResult) |
| 184 | } |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | run() |
| 189 |
no test coverage detected