* Returns the state changes applied when a query receives data. * @param data - The new data. * @param dataUpdatedAt - The timestamp the data is recorded with. Defaults to the current time. * @returns The partial query state for a successful update.
(data: TData | undefined, dataUpdatedAt?: number)
| 1081 | * @returns The partial query state for a successful update. |
| 1082 | */ |
| 1083 | function successState<TData>(data: TData | undefined, dataUpdatedAt?: number) { |
| 1084 | return { |
| 1085 | data, |
| 1086 | dataUpdatedAt: dataUpdatedAt ?? Date.now(), |
| 1087 | error: null, |
| 1088 | isInvalidated: false, |
| 1089 | status: 'success' as const, |
| 1090 | } |
| 1091 | } |
| 1092 | |
| 1093 | /** |
| 1094 | * Returns the initial state of a query, based on its `initialData` and `initialDataUpdatedAt` |
no outgoing calls
no test coverage detected