當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript data.serializeRecordIdentity函數代碼示例

本文整理匯總了TypeScript中@orbit/data.serializeRecordIdentity函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript serializeRecordIdentity函數的具體用法?TypeScript serializeRecordIdentity怎麽用?TypeScript serializeRecordIdentity使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了serializeRecordIdentity函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: _serializeInverseRelationshipIdentity

 protected _serializeInverseRelationshipIdentity(
   ri: RecordRelationshipIdentity
 ): string {
   return [
     serializeRecordIdentity(ri.record),
     ri.relationship,
     serializeRecordIdentity(ri.relatedRecord)
   ].join('::');
 }
開發者ID:orbitjs,項目名稱:orbit.js,代碼行數:9,代碼來源:cache.ts

示例2: _toInverseRelationshipForIDB

 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
   };
 }
開發者ID:orbitjs,項目名稱:orbit.js,代碼行數:12,代碼來源:cache.ts

示例3: Promise

    return new Promise((resolve, reject) => {
      const transaction = this._db.transaction([INVERSE_RELS]);
      const objectStore = transaction.objectStore(INVERSE_RELS);
      const results: RecordRelationshipIdentity[] = [];
      const keyRange = Orbit.globals.IDBKeyRange.only(
        serializeRecordIdentity(recordIdentity)
      );
      const request = objectStore.index('recordIdentity').openCursor(keyRange);

      request.onerror = function(/* event */) {
        // console.error('error - getRecords', request.error);
        reject(request.error);
      };

      request.onsuccess = (event: any) => {
        // console.log('success - getInverseRelationshipsAsync', request.result);
        const cursor = event.target.result;
        if (cursor) {
          let result = this._fromInverseRelationshipForIDB(cursor.value);
          results.push(result);
          cursor.continue();
        } else {
          resolve(results);
        }
      };
    });
開發者ID:orbitjs,項目名稱:orbit.js,代碼行數:26,代碼來源:cache.ts

示例4: _materialize

  protected _materialize(identity: RecordIdentity): RecordModel {
    const identifier = serializeRecordIdentity(identity);
    const record = this._factory.create(identity);

    this._map[identifier] = record;

    return record;
  }
開發者ID:orbitjs,項目名稱:ember-orbit,代碼行數:8,代碼來源:identity-map.ts

示例5: _materialized

  protected _materialized(identity: RecordIdentity) {
    if (!identity) {
      return;
    }

    const identifier = serializeRecordIdentity(identity);

    return this._map[identifier];
  }
開發者ID:orbitjs,項目名稱:ember-orbit,代碼行數:9,代碼來源:identity-map.ts

示例6: evict

  evict(identity: RecordIdentity) {
    const record = this._materialized(identity);

    if (record) {
      const identifier = serializeRecordIdentity(identity);
      delete this._map[identifier];
      this._factory.disconnect(record);
    }
  }
開發者ID:orbitjs,項目名稱:ember-orbit,代碼行數:9,代碼來源:identity-map.ts

示例7: serialize

 serialize(identity: RecordIdentity): string {
   return serializeRecordIdentity(identity);
 }
開發者ID:orbitjs,項目名稱:orbit.js,代碼行數:3,代碼來源:record-identity-serializer.ts


注:本文中的@orbit/data.serializeRecordIdentity函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。