()
| 269 | |
| 270 | let taskQueue: Array<() => void> = [] |
| 271 | const subscribeToObserver = () => |
| 272 | observer.subscribe((result) => { |
| 273 | taskQueue.push(() => { |
| 274 | batch(() => { |
| 275 | const dataResources_ = dataResources() |
| 276 | for (let index = 0; index < dataResources_.length; index++) { |
| 277 | const dataResource = dataResources_[index]! |
| 278 | const unwrappedResult = { ...unwrap(result[index]) } |
| 279 | // @ts-expect-error typescript pedantry regarding the possible range of index |
| 280 | setState(index, unwrap(unwrappedResult)) |
| 281 | dataResource[1].mutate(() => unwrap(state[index]!.data)) |
| 282 | dataResource[1].refetch() |
| 283 | } |
| 284 | }) |
| 285 | }) |
| 286 | |
| 287 | queueMicrotask(() => { |
| 288 | const taskToRun = taskQueue.pop() |
| 289 | if (taskToRun) taskToRun() |
| 290 | taskQueue = [] |
| 291 | }) |
| 292 | }) |
| 293 | |
| 294 | let unsubscribe: () => void = noop |
| 295 | createComputed<() => void>((cleanup) => { |
no test coverage detected
searching dependent graphs…