Skip to main content
Version: v9.0.0

OptimisticMatchType

Selects the list items a helper changes.

  • A predicate: (todo) => todo.id === todoId

  • A plain value compared with the item's key field ( id by default). Numbers and strings match each other, so a route param "1" matches the id 1 .


Import
import { OptimisticMatchType } from "@hyper-fetch/core"

Preview​

type OptimisticMatchType<Item,Key> = (item: Item) => boolean | ([Key] extends [never] ? never : (Item[Key] extends ParamType ? ParamType : Item[Key]));