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


TypeScript ReplaySubject.next方法代碼示例

本文整理匯總了TypeScript中rxjs.ReplaySubject.next方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ReplaySubject.next方法的具體用法?TypeScript ReplaySubject.next怎麽用?TypeScript ReplaySubject.next使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在rxjs.ReplaySubject的用法示例。


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

示例1: it

        it('should not react when unregistered action dispatched.', fakeAsync(() => {
            const callback = jasmine.createSpy('callback');
            const subscription = effects.detectChanges.subscribe(callback);

            const fileChanges = createDummies(fileChangeDummy, 10);

            (vcsService.fetchFileChanges as Spy).and.returnValue(of(fileChanges));

            actions.next(testActions.unregisteredAction);
            tick(VCS_DETECT_CHANGES_THROTTLE_TIME);

            expect(callback).not.toHaveBeenCalledWith(new UpdateFileChangesAction({ fileChanges }));
            subscription.unsubscribe();
        }));
開發者ID:suiruiw,項目名稱:geeks-diary,代碼行數:14,代碼來源:vcs.effects.spec.ts

示例2:

 (data) => {
   components.next(data.children.reduce((accum, child) => {
     if (child.name.match(regexComponent) && child.children) {
       for (const grandchild of child.children) {
         if (!!grandchild.decorators &&
             (grandchild.decorators[0].name === 'Component' ||
             grandchild.decorators[0].name === 'Directive')) {
               accum.push(grandchild);
         }
       }
     }
     return accum;
   }, []));
 },
開發者ID:GSA,項目名稱:sam-web-design-standards,代碼行數:14,代碼來源:documentation.service.ts

示例3: getNpmConfigOption

function getNpmConfigOption(
  option: string,
  scope?: string,
  tryWithoutScope?: boolean,
): Observable<string | undefined> {
  if (scope && tryWithoutScope) {
    return concat(
      getNpmConfigOption(option, scope),
      getNpmConfigOption(option),
    ).pipe(
      filter(result => !!result),
      defaultIfEmpty(),
      first(),
    );
  }

  const fullOption = `${scope ? scope + ':' : ''}${option}`;

  let value = npmConfigOptionCache.get(fullOption);
  if (value) {
    return value;
  }

  const subject = new ReplaySubject<string | undefined>(1);

  try {
    exec(`npm get ${fullOption}`, (error, data) => {
      if (error) {
        subject.next();
      } else {
        data = data.trim();
        if (!data || data === 'undefined' || data === 'null') {
          subject.next();
        } else {
          subject.next(data);
        }
      }

      subject.complete();
    });
  } catch {
    subject.next();
    subject.complete();
  }

  value = subject.asObservable();
  npmConfigOptionCache.set(fullOption, value);

  return value;
}
開發者ID:fmalcher,項目名稱:angular-cli,代碼行數:50,代碼來源:npm.ts

示例4: _updateWithDirection

  // *********************************************
  // Protected methods
  // *********************************************

  /** Validate the direction value and then update the host's inline flexbox styles */
  protected _updateWithDirection(value?: string) {
    value = value || this._queryInput('layout') || 'row';
    if (this._mqActivation) {
      value = this._mqActivation.activatedInput;
    }

    // Update styles and announce to subscribers the *new* direction
    let css = buildLayoutCSS(!!value ? value : '');

    this._applyStyleToElement(css);
    this._announcer.next({
      direction: css['flex-direction'],
      wrap: !!css['flex-wrap'] && css['flex-wrap'] !== 'nowrap'
    });
  }
開發者ID:marffox,項目名稱:flex-layout,代碼行數:20,代碼來源:layout.ts

示例5: fakeAsync

            + 'with the note content, when success.', fakeAsync(() => {
            (noteEditor.loadNoteContent as jasmine.Spy).and.returnValue(of(content));

            const callback = jasmine.createSpy('load callback');
            const subscription = contentEffects.load.subscribe(callback);

            actions.next(new LoadNoteContentAction({ note: noteItem }));
            tick(NOTE_EDITOR_LOAD_NOTE_CONTENT_THROTTLE);

            expect(callback).toHaveBeenCalledWith(new LoadNoteContentCompleteAction({
                note: noteItem,
                content,
            }));
            subscription.unsubscribe();
        }));
開發者ID:suiruiw,項目名稱:geeks-diary,代碼行數:15,代碼來源:note-content.effects.spec.ts

示例6: beforeEach

  beforeEach(() => {
    const httpStateServiceStub = { httpAction: httpAction };
    httpAction.next({});

    TestBed.configureTestingModule({
      schemas: [NO_ERRORS_SCHEMA],
      imports: [
        TranslateModule.forRoot({ loader: { provide: TranslateLoader, useClass: TranslateFakeLoader } })
      ],
      declarations: [SaveButtonComponent],
      providers: [
        { provide: HttpStateService, useValue: httpStateServiceStub }
      ]
    });
    fixture = TestBed.createComponent(SaveButtonComponent);
    component = fixture.componentInstance;
  });
開發者ID:OysteinAmundsen,項目名稱:gymsystems,代碼行數:17,代碼來源:save-button.component.spec.ts

示例7: if

 (data) => {
   if (data.children) {
     data.children = data.children.filter((child) => {
       if (!!child.decorators &&
           (child.decorators[0].name === 'Input' ||
            child.decorators[0].name === 'Output')) {
              return child;
            }
     });
     data.children = data.children.sort((prev, next) => {
       if (prev.decorators[0].name === 'Input' && next.decorators[0].name === 'Output') {
         return -1;
       } else if (prev.decorators[0].name === 'Output' && next.decorators[0].name === 'Input') {
         return 1;
       } else {
         return (prev.name).localeCompare(next.name);
       }
     });
     properties.next(
       data.children
     );
   }
 },
開發者ID:GSA,項目名稱:sam-web-design-standards,代碼行數:23,代碼來源:documentation.service.ts


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