* 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)
| 1072 | * @returns The partial query state for a successful update. |
| 1073 | */ |
| 1074 | function successState<TData>(data: TData | undefined, dataUpdatedAt?: number) { |
| 1075 | return { |
| 1076 | data, |
| 1077 | dataUpdatedAt: dataUpdatedAt ?? Date.now(), |
| 1078 | error: null, |
| 1079 | isInvalidated: false, |
| 1080 | status: 'success' as const, |
| 1081 | } |
| 1082 | } |
| 1083 | |
| 1084 | /** |
| 1085 | * Returns the initial state of a query, based on its `initialData` and `initialDataUpdatedAt` |
no outgoing calls
no test coverage detected