Identifiable

Source
import type { Identifiable } from "@prestojs/util";

Interface for types that we can automatically extract a unique identifier from.

To confirm to the interface provide a _key property or getter.

ViewModelFactory conforms to this so anything that expects an Identifiable will accept a ViewModel.

Implementing this can save you having to pass explicit functions to identify an item in other parts of the system (eg. for AsyncChoices or useAsyncValue)

API

Properties