当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript operators.ignoreElements函数代码示例

本文整理汇总了TypeScript中rxjs/operators.ignoreElements函数的典型用法代码示例。如果您正苦于以下问题:TypeScript ignoreElements函数的具体用法?TypeScript ignoreElements怎么用?TypeScript ignoreElements使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ignoreElements函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: observableDefer

  return observableDefer(() => {
    if (shouldUnsetMediaKeys()) {
      return disposeMediaKeys(mediaElement, attachedMediaKeysInfos)
        .pipe(ignoreElements());
    }

    const currentState = attachedMediaKeysInfos.getState(mediaElement);
    if (currentState && currentState.keySystemOptions.closeSessionsOnStop) {
      return currentState.sessionsStore.closeAllSessions()
        .pipe(ignoreElements());
    }
    return EMPTY;
  });
开发者ID:canalplus,项目名称:rx-player,代码行数:13,代码来源:eme_manager.ts

示例2: mergeMap

    mergeMap((sessionInfosEvt) =>  {
      if (sessionInfosEvt.type === "warning") {
        return observableOf(sessionInfosEvt);
      }

      const {
        initData,
        initDataType,
        mediaKeySession,
        sessionType,
        keySystemOptions,
        sessionStorage,
      } = sessionInfosEvt.value;

      return observableMerge(
        handleSessionEvents(mediaKeySession, keySystemOptions),

        // only perform generate request on new sessions
        sessionInfosEvt.type === "created-session" ?
          generateKeyRequest(mediaKeySession, initData, initDataType).pipe(
            tap(() => {
              if (sessionType === "persistent-license" && sessionStorage != null) {
                sessionStorage.add(initData, initDataType, mediaKeySession);
              }
            }),
            catchError((error: Error) => {
              throw new EncryptedMediaError(
                "KEY_GENERATE_REQUEST_ERROR", error.toString(), false);
            }),
            ignoreElements()
          ) : EMPTY
      ).pipe(filter((sessionEvent) : sessionEvent is IEMEWarningEvent =>
        sessionEvent.type === "warning"
      ));
    })
开发者ID:canalplus,项目名称:rx-player,代码行数:35,代码来源:eme_manager.ts

示例3: concatMap

 concatMap(normalized => {
   return from([normalized.replace, normalized.with]).pipe(
     mergeMap(path => host.exists(path).pipe(errorOnFalse(path))),
     ignoreElements(),
     concat(of(normalized)),
   );
 }),
开发者ID:baconwaffles,项目名称:angular-cli,代码行数:7,代码来源:normalize-file-replacements.ts

示例4: observableConcat

    ).pipe(mergeMap(() => {
      const cleaningOldSessions$ : Array<Observable<unknown>> = [];
      const entries = sessionsStore.getAll().slice();
      if (MAX_SESSIONS > 0 && MAX_SESSIONS <= entries.length) {
        for (let i = 0; i < (MAX_SESSIONS - entries.length + 1); i++) {
          cleaningOldSessions$.push(
            sessionsStore.deleteAndCloseSession(entries[i].session)
          );
        }
      }

      return observableConcat(
        observableMerge(...cleaningOldSessions$).pipe(ignoreElements()),
        createSession(initData, initDataType, mediaKeysInfos)
          .pipe(map((evt) => ({
            type: evt.type,
            value: {
              mediaKeySession: evt.value.mediaKeySession,
              sessionType: evt.value.sessionType,
              initData,
              initDataType,
            },
          })))
      );
    }));
开发者ID:canalplus,项目名称:rx-player,代码行数:25,代码来源:get_session.ts

示例5: mergeMap

      mergeMap(isDirectory => {
        if (isDirectory) {
          const allFiles: Path[] = [];
          const allDirs: Path[] = [];
          const _recurseList = (path: Path) => {
            for (const fragment of fs.readdirSync(getSystemPath(path))) {
              if (fs.statSync(getSystemPath(join(path, fragment))).isDirectory()) {
                _recurseList(join(path, fragment));
                allDirs.push(join(path, fragment));
              } else {
                allFiles.push(join(path, fragment));
              }
            }
          };
          _recurseList(path);

          return concat(
            observableFrom(allFiles).pipe(
              mergeMap(p => _callFs(fs.unlink, getSystemPath(p))),
              ignoreElements(),
            ),
            observableFrom(allDirs).pipe(
              concatMap(p => _callFs(fs.rmdir, getSystemPath(p))),
              map(() => {}),
            ),
          );
        } else {
          return _callFs(fs.unlink, getSystemPath(path));
        }
      }),
开发者ID:fmalcher,项目名称:angular-cli,代码行数:30,代码来源:host.ts

示例6: asDiagram

  asDiagram('ignoreElements')('should ignore all the elements of the source', () => {
    const source = hot('--a--b--c--d--|');
    const subs =       '^             !';
    const expected =   '--------------|';

    expectObservable(source.pipe(ignoreElements())).toBe(expected);
    expectSubscriptions(source.subscriptions).toBe(subs);
  });
开发者ID:DallanQ,项目名称:rxjs,代码行数:8,代码来源:ignoreElements-spec.ts

示例7: it

  it('should support Observable.throw', () => {
    const source = cold('#');
    const subs =        '(^!)';
    const expected =    '#';

    expectObservable(source.pipe(ignoreElements())).toBe(expected);
    expectSubscriptions(source.subscriptions).toBe(subs);
  });
开发者ID:DallanQ,项目名称:rxjs,代码行数:8,代码来源:ignoreElements-spec.ts

示例8: observableDefer

 return observableDefer(() => {
   const previousEntries = this._entries;
   this._entries = []; // clean completely the cache first
   const disposed = previousEntries
     .map((entry) => this.deleteAndCloseSession(entry.session));
   return observableConcat(
     observableMerge(...disposed).pipe(ignoreElements()),
     observableOf(null)
   );
 });
开发者ID:canalplus,项目名称:rx-player,代码行数:10,代码来源:open_sessions_store.ts

示例9: omit

  useEpic((actor$) => {
    return actor$.pipe(
      rxFilter(RequestActor.isRequestActor),
      rxScan(
        (counts, actor: any) => {
          const parentActorType = actor.opts.parentActor.type;

          const count = counts[parentActorType] || 0;

          if (actor.stage === AsyncStage.STARTED) {
            return {
              ...counts,
              [parentActorType]: count + 1,
            };
          }

          if (count > 1) {
            return {
              ...counts,
              [parentActorType]: count - 1,
            };
          }

          return omit(counts, parentActorType);
        },
        {} as Dictionary<number>,
      ),
      rxTap((nextRequests) => {
        requesting$.next(size(nextRequests) > 0);
      }),
      rxIgnoreElements(),
    );
  });
开发者ID:querycap,项目名称:reactorx,代码行数:33,代码来源:useRequesting$.ts


注:本文中的rxjs/operators.ignoreElements函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。