( patches: ReadonlyArray<Patch>, query: R, args: Args<R>, value: Success<R> )
| 1666 | * @since 4.2.0 |
| 1667 | */ |
| 1668 | export const applyPatches = <R extends Query.Any>( |
| 1669 | patches: ReadonlyArray<Patch>, |
| 1670 | query: R, |
| 1671 | args: Args<R>, |
| 1672 | value: Success<R> |
| 1673 | ): Success<R> => { |
| 1674 | const def = defOf(query) |
| 1675 | const argsKey = def.argsKey(args) |
| 1676 | for (const patch of patches) { |
| 1677 | value = applyPatch(patch, def.name, argsKey, args, value) as Success< |
| 1678 | R |
| 1679 | > |
| 1680 | } |
| 1681 | return value |
| 1682 | } |
| 1683 | |
| 1684 | /** |
| 1685 | * Whether a run with these `invalidates` and `optimistic` declarations |
no test coverage detected