Skip to content

matchbox

matchbox<DataSpecs, Tag, TagProp>(tag: Tag, data: any, tagProp: TagProp): MatchboxMember<Tag, DataSpecs, TagProp>

Defined in: matchbox-factory.ts:82

matchbox creates a single Matchbox variant instance.

Type ParameterDefault type
DataSpecs-
Tag extends string | number | symbol-
TagProp extends string"tag"
ParameterTypeDescription
tagTagThe tag value for the variant.
dataanyThe data associated with the variant.
tagPropTagPropThe property name used for the tag (default: “tag”).

MatchboxMember<Tag, DataSpecs, TagProp>

A Matchbox instance with type-safe API methods.