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