OptimisticTargetType
Helpers available for a target. The list helpers exist when the target's data is an array; for a list inside an
object name it first with
.list("field")
.
Import
import { OptimisticTargetType } from "@hyper-fetch/core"
Source
Package
Preview
type OptimisticTargetType<Data,Mutation> = { set: (updater: (data: Data) => Data) => OptimisticOperation<Data, Mutation> } & (0 extends (1 & Data) ? (OptimisticListTargetType<Data, any, Mutation> & OptimisticEntryTargetType<Data, Mutation>) : ([Data] extends [readonly infer Item[]] ? OptimisticListTargetType<Data, Item, Mutation> : OptimisticEntryTargetType<Data, Mutation>));
Structure
OptimisticTargetType
| Name | Type | Description |
|---|---|---|
| set | | Replaces the data with the updater's result |

