getId

Source
import { getId } from "@prestojs/util";
getId(item,?fallbackGetId)

Get the id for an object. If object doesn't implement Identifiable then fallbackGetId must be provided or an error will be thrown.

ParameterTypeDescription
*itemIdentifiable|any

Any value to get ID for

fallbackGetId
Function

Function to return id for item if it doesn't implement Identifiable

One of the following:

SingleId

OR

{[ fieldName: string ]: SingleId}