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


TypeScript BehaviorSubject.next方法代码示例

本文整理汇总了TypeScript中rxjs/BehaviorSubject.BehaviorSubject.next方法的典型用法代码示例。如果您正苦于以下问题:TypeScript BehaviorSubject.next方法的具体用法?TypeScript BehaviorSubject.next怎么用?TypeScript BehaviorSubject.next使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rxjs/BehaviorSubject.BehaviorSubject的用法示例。


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

示例1:

 this.textInput.valueChanges.debounceTime(500).subscribe((value)=>{
     if(this._validate(value)) {
         this.textInput.setValue(value);
         this.value.next(value);
     } else {
         this.textInput.setValue(this._currentValue);
         this.value.next(this._currentValue);
     }
 })
开发者ID:EremenkoAndrey,项目名称:july,代码行数:9,代码来源:product-count.component.ts

示例2: setDrinkTimestamps

 setDrinkTimestamps(startAt: string, endAt: string): void {
   clearTimeout(this.startDrinksAtTimestampCallback);
   clearTimeout(this.endDrinksAtTimestampCallback);
   if (startAt && endAt) {
     this.startDrinksAtTimestamp.next(startAt);
     this.endDrinksAtTimestamp.next(endAt);
   } else if (startAt) {
     this.startDrinksAtTimestamp.next(startAt);
     this.updateEndDrinksAtTimestamp();
   } else {
     this.updateStartDrinksAtTimestamp();
     this.updateEndDrinksAtTimestamp();
   }
 }
开发者ID:adamstegman,项目名称:drank,代码行数:14,代码来源:drinks.service.ts

示例3:

 .map(isParticipant => {
     this._currentUser.member.matchplayParticipant = isParticipant;
     this.saveToStorage('bhmc_user', JSON.stringify(this._currentUser));
     this.errorHandler.setUserContext(this._currentUser);
     this.currentUserSource.next(this._currentUser);
     return;
 })
开发者ID:finleysg,项目名称:bhmc,代码行数:7,代码来源:authentication.service.ts

示例4: User

 .map(data => {
     let user = new User().fromJson(data);
     this.saveToStorage('bhmc_user', JSON.stringify(user));
     this._currentUser = user;
     this.currentUserSource.next(this._currentUser);
     return;
 })
开发者ID:finleysg,项目名称:bhmc,代码行数:7,代码来源:authentication.service.ts

示例5: beforeEach

    beforeEach(() => {
        addProviders([
            { provide: Platform, useClass: MockClass },
            { provide: Http, useClass: HttpMock },
            { provide: NavController, useClass: NavMock },
            { provide: DataService, useClass: MockDataService },
        ]);
 
        platform      = new MockClass();
        navMock       = new NavMock();
        window.localStorage.setItem('project_data', JSON.stringify(platform.getData()));

        data          = platform.getData();
        var _data     = JSON.stringify(data);

        //Set Initial State
        window.localStorage.setItem('project_data', _data);
        window.localStorage.setItem('project_id', '5');

        observable    = new BehaviorSubject(data);
        observable.next(data);

        dataService   = new DataService(httpMock);
        spyOn(dataService, 'fetchData').and.returnValue(observable);

        chart         = new Chart(dataService);
        netattraction = new Netattraction();
    });
开发者ID:peb7268,项目名称:ionic-dashboard,代码行数:28,代码来源:netattraction.spec.ts

示例6: setConfig

	setConfig(name: string, value: any) {
		if (!this[name]) {
			this[name] = new BehaviorSubject({});
		}

		this[name].next(value);
	}
开发者ID:radfahrer,项目名称:BossyUI,代码行数:7,代码来源:config.service.ts

示例7: getWorkItemList

    getWorkItemList(idList: Array<number>) : Observable<WorkItemList> {
        let returnValue = new WorkItemList();
        let subject = new BehaviorSubject<WorkItemList>(null);

        if (idList.length > 0) {
            let server = this.window.localStorage.getItem('server');
            
            let workItemUrl = server + '/DefaultCollection/_apis/wit/WorkItems?ids=' + idList.join() + '&fields=System.Id,System.WorkItemType,System.Title,System.AssignedTo,System.State&api-version=1.0';

            this.oAuthHttp.get(workItemUrl).subscribe(res => {
                let result = res.json();

                result.value.forEach(workItemJson => {
                    let workItem = new WorkItem();
                    workItem.populate(workItemJson);
                    returnValue.push(workItem);
                });

                subject.next(returnValue);
            });
        }
        else {
            subject.next(returnValue);
        }

        return subject.asObservable();
    }
开发者ID:CaringIsCreepy,项目名称:VSTS-Mobile,代码行数:27,代码来源:work-item-service.ts

示例8: registerApp

  public registerApp(appClass: AppClass = App, opts: RegisterAppOptions = {}) {
    const options = {
      multi: false,
      ...opts,
    };

    if (typeof options.name !== 'undefined') {
      Object.defineProperty(appClass, 'frintAppName', {
        value: options.name,
        configurable: true,
      });
    }

    const existingIndex = findIndex(this._appsCollection, (w) => {
      return w.name === appClass.frintAppName;
    });

    if (existingIndex !== -1) {
      throw new Error(`App '${appClass.frintAppName}' has been already registered before.`);
    }

    this._appsCollection.push({
      ...options,
      name: appClass.frintAppName,
      appClass,
      instances: {},
      regions: options.regions || [],
    });

    if (options.multi === false) {
      this.instantiateApp(appClass.frintAppName);
    }

    this._apps$.next(this._appsCollection);
  }
开发者ID:Travix-International,项目名称:frint,代码行数:35,代码来源:App.ts

示例9:

 accounts.forEach(account => {
   if (account.id === this.userSessionStore.account.id) {
     let session = this.userSessionStore;
     this.userSessionStore = { account: session.account };
     this._userSession.next(session);
   }
 });
开发者ID:vintage-software,项目名称:vstack-server-demo,代码行数:7,代码来源:auth.service.ts

示例10: WobInfoModelList

			.then((contents: WobInfoModelList) => {
				// Cache location contents and notify
				this._locationContents = contents;
				this.locationContents.next(contents);

				var ids: number[] = [];
				contents.list.forEach((wob) => {
					ids.push(wob.id);
				});

				var players: WobInfoModel[] = [];
				this.wobService.instanceOf(ids, "@player")
					.then((results: InstanceOfModelList) => {
						results.list.forEach((result) => {
							if (result.isInstance) {
								players.push(contents.list.find((value: WobInfoModel) =>  {
									return value.id == result.id;
								}));
							}
						});

						// Cache nearby players list and notify
						this._locationPlayers = new WobInfoModelList(players);
						this.locationPlayers.next(this._locationPlayers);
					});

				return contents;
			});
开发者ID:deciare,项目名称:flowerbox-web-angular,代码行数:28,代码来源:status.service.ts


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