當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。