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