How to use the @orbit/data.serializeRecordIdentity function in @orbit/data

To help you get started, we’ve selected a few @orbit/data examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github orbitjs / ember-orbit / addon / -private / identity-map.ts View on Github external
protected _materialize(identity: RecordIdentity): RecordModel {
    const identifier = serializeRecordIdentity(identity);
    const record = this._factory.create(identity);

    this._map[identifier] = record;

    return record;
  }
}
github orbitjs / orbit / packages / @orbit / indexeddb / src / indexeddb-cache.ts View on Github external
protected _toInverseRelationshipForIDB(
    ri: RecordRelationshipIdentity
  ): InverseRelationshipForIDB {
    return {
      id: this._serializeInverseRelationshipIdentity(ri),
      recordIdentity: serializeRecordIdentity(ri.record),
      relationship: ri.relationship,
      relatedIdentity: serializeRecordIdentity(ri.relatedRecord),
      type: ri.record.type,
      relatedType: ri.relatedRecord.type
    };
  }
github orbitjs / ember-orbit / addon / -private / identity-map.ts View on Github external
evict(identity: RecordIdentity) {
    const record = this._materialized(identity);

    if (record) {
      const identifier = serializeRecordIdentity(identity);
      delete this._map[identifier];
      this._factory.disconnect(record);
    }
  }
github orbitjs / orbit / packages / @orbit / indexeddb / src / indexeddb-cache.ts View on Github external
protected _serializeInverseRelationshipIdentity(
    ri: RecordRelationshipIdentity
  ): string {
    return [
      serializeRecordIdentity(ri.record),
      ri.relationship,
      serializeRecordIdentity(ri.relatedRecord)
    ].join('::');
  }
github orbitjs / orbit / packages / @orbit / indexeddb / src / indexeddb-cache.ts View on Github external
protected _toInverseRelationshipForIDB(
    ri: RecordRelationshipIdentity
  ): InverseRelationshipForIDB {
    return {
      id: this._serializeInverseRelationshipIdentity(ri),
      recordIdentity: serializeRecordIdentity(ri.record),
      relationship: ri.relationship,
      relatedIdentity: serializeRecordIdentity(ri.relatedRecord),
      type: ri.record.type,
      relatedType: ri.relatedRecord.type
    };
  }
github orbitjs / orbit / packages / @orbit / indexeddb / src / indexeddb-cache.ts View on Github external
protected _serializeInverseRelationshipIdentity(
    ri: RecordRelationshipIdentity
  ): string {
    return [
      serializeRecordIdentity(ri.record),
      ri.relationship,
      serializeRecordIdentity(ri.relatedRecord)
    ].join('::');
  }