Function
recordIdentifierFor (record) StableRecordIdentifier public
Module:
@ember-data/store
Defined in ../store/addon/-private/caches/instance-cache.ts:62
- record
- Object
- a record instance previously obstained from the store.
- returns
- StableRecordIdentifier
Retrieves the unique referentially-stable RecordIdentifier assigned to the given record instance.
1 2 3 4 5 6 7 |
import { recordIdentifierFor } from "@ember-data/store"; // ... gain access to a record, for instance with peekRecord or findRecord const record = store.peekRecord("user", "1"); // get the identifier for the record (see docs for StableRecordIdentifier) const identifier = recordIdentifierFor(record); // access the identifier's properties. const { id, type, lid } = identifier; |