How to use the rxjs-spy/operators/tag.tag function in rxjs-spy

To help you get started, we’ve selected a few rxjs-spy 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 jupyterlab / jupyterlab-data-explorer / dataregistry / src / converters.ts View on Github external
export function applyConverter$(
  datasets$: Datasets$,
  converter$: Observable>
): Datasets$ {
  return combineLatest(datasets$, converter$).pipe(
    tag("applyConverter$/zipped"),
    // Take latest output and merge with most recent
    scan(
      (acc: Datasets, [datasets, converter]) =>
        applyConverterDatasets(acc, datasets, converter),
      new Map()
    ),
    shareReplay({ bufferSize: 1, refCount: true }),
    tag("applyConverter$/scanned")
  );
}
github jupyterlab / jupyterlab-data-explorer / packages / dataregistry / src / testutils.ts View on Github external
constructor(observable: Observable) {
    observable.pipe(tag('ToPromise')).subscribe(next => {
      const promise = this._promises.pop();
      if (promise === undefined) {
        this._values.push(next);
      } else {
        promise(next);
      }
    });
  }
}
github cloudfoundry / stratos / src / frontend / app / shared / monitors / entity-monitor.ts View on Github external
poll(interval = 10000, action: Function, getActionState: (request: RequestInfoState) => ActionState) {
    return observableInterval(interval)
      .pipe(
        tag('poll'),
        withLatestFrom(
          this.entity$,
          this.entityRequest$
        ),
        map(([poll, resource, requestState]) => ({
          resource,
          updatingSection: getActionState(requestState)
        })),
        tap(({ resource, updatingSection }) => {
          if (!updatingSection || !updatingSection.busy) {
            action();
          }
        }),
        filter(({ resource, updatingSection }) => {
          return !!updatingSection;
        }),
github cloudfoundry / stratos / src / frontend / app / shared / components / list / data-sources-controllers / local-list-controller.ts View on Github external
})),
      currentPageNumber$,
    ).pipe(
      map(([entities, pageSize, currentPage]) => {
        const pages = this.pageSplitCache ? this.pageSplitCache : entities;
        const data = splitCurrentPage(
          pages,
          pageSize,
          currentPage
        );
        this.pageSplitCache = data.entities;
        return (data.entities[data.index] || []) as T[];
      }),
      publishReplay(1),
      refCount(),
      tag('local-list')
    );
  }
github cloudfoundry / stratos / src / frontend / packages / cloud-foundry / src / shared / components / list / list-types / app / cf-apps-data-source.ts View on Github external
const appGuid = app.metadata.guid;
          const cfGuid = app.entity.cfGuid;
          if (appState === 'STARTED') {
            const appStatsEntity = entityCatalogue.getEntity(CF_ENDPOINT_TYPE, appStatsEntityType);
            const actionBuilder = appStatsEntity.actionOrchestrator.getActionBuilder('get');
            const getAction = actionBuilder(appGuid, cfGuid);
            actions.push({
              id: appGuid,
              action: getAction
            });
          }
        });
        return actions;
      }),
      dispatchSequencer.sequence.bind(dispatchSequencer),
      tag('stat-obs')
    ).subscribe();

    this.subs = [statsSub];
  }
github cloudfoundry / stratos / src / frontend / app / shared / data-sources / list-data-source.ts View on Github external
entities = dataFunctions.reduce((value, fn) => {
            return fn(value, paginationEntity);
          }, entities);
        }
        const pages = this.splitClientPages(entities, paginationEntity.clientPagination.pageSize);
        if (
          paginationEntity.totalResults !== entities.length ||
          paginationEntity.clientPagination.totalResults !== entities.length
        ) {
          this.store.dispatch(new SetResultCount(this.entityKey, this.paginationKey, entities.length));
        }
        const pageIndex = paginationEntity.clientPagination.currentPage - 1;
        return pages[pageIndex];
      }),
      shareReplay(1),
      tag('local-list')
      );
  }
github cloudfoundry / stratos / src / frontend / packages / core / src / shared / components / list / data-sources-controllers / local-list-controller.ts View on Github external
})),
      currentPageNumber$,
    ).pipe(
      map(([entities, pageSize, currentPage]) => {
        const pages = this.pageSplitCache ? this.pageSplitCache : entities;
        const data = splitCurrentPage(
          pages,
          pageSize,
          currentPage
        );
        this.pageSplitCache = data.entities;
        return (data.entities[data.index] || []) as T[];
      }),
      publishReplay(1),
      refCount(),
      tag('local-list')
    );
  }
github jupyterlab / jupyterlab-data-explorer / dataregistry / src / utils.ts View on Github external
constructor(values: Iterable) {
    this.observable = this._observable.pipe(tag("ObservableSet"));
    this.add(...values);
  }
github cloudfoundry / stratos / src / frontend / packages / core / src / shared / components / list / list-types / app / cf-apps-data-source.ts View on Github external
const appGuid = app.metadata.guid;
          const cfGuid = app.entity.cfGuid;
          if (appState === 'STARTED') {
            const appStatsEntity = entityCatalogue.getEntity(STRATOS_ENDPOINT_TYPE, appStatsEntityType);
            const actionBuilder = appStatsEntity.actionOrchestrator.getActionBuilder('get');
            const action = actionBuilder(appGuid, cfGuid);
            actions.push({
              id: appGuid,
              action
            });
          }
        });
        return actions;
      }),
      dispatchSequencer.sequence.bind(dispatchSequencer),
      tag('stat-obs')
    ).subscribe();

    this.subs = [statsSub];
  }
github cloudfoundry / stratos / src / frontend / packages / core / src / app / shared / components / list / list-types / app / cf-apps-data-source.ts View on Github external
page.forEach(app => {
          const appState = app.entity.state;
          const appGuid = app.metadata.guid;
          const cfGuid = app.entity.cfGuid;
          const dispatching = false;
          if (appState === 'STARTED') {
            actions.push({
              id: appGuid,
              action: new GetAppStatsAction(appGuid, cfGuid)
            });
          }
        });
        return actions;
      }),
      dispatchSequencer.sequence.bind(dispatchSequencer),
      tag('stat-obs')).subscribe();
  }
}

rxjs-spy

A debugging library for RxJS

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis