Skip to content

Partial Match

This plugin enables users to map matches of assets to any arbitrary value in a partial-match-registry. For each asset in a resolved view, the matches will be computed.

Usage

Create a registry and add matches:

import { Registry } from "@player-ui/partial-match-registry";
const registry = new Registry([[{ type: "action" }, "ABC"]]);

Add the registy to a plugin:

import { Player } from "@player-ui/player";
import { PartialMatchFingerprintPlugin } from "@player-ui/partial-match-fingerprint-plugin";
const matchPlugin = new PartialMatchFingerprintPlugin(registry);
const player = new Player({
plugins: [matchPlugin],
});

Query the plugin for matches:

const value = matchPlugin.get("asset-id"); // 'ABC'