当前位置: 首页>>代码示例>>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;未经允许,请勿转载。