onSubmit() { const input = { type: 'user', sessionId: this.wsSessionId, msg: this.userMsg, tz: this.timezone }; this.ws$.next(JSON.stringify(input)); this.pushMsg(input, true); this.botIsTyping = true; }
sendData(){ this.validateDataBundle(this.dataBundle) this.dataBundle.changellyFeeOne = this.dataBundle.changellyFeeOne.toString() || undefined this.dataBundle.estConvToNav = this.dataBundle.estConvToNav.toString() || undefined this.dataStored = true this.dataSubject.next(this.dataBundle) console.log('data sent') }
announceProjectSelected(project: ProjectModel){ if(project){ this.projectIdSelected = project._id; } else { this.projectIdSelected = null; } this.announceSuiteSelected(null); this.selectedProject.next(project); }
useEffect(() => { this.stream .pipe(map(selector), takeUntil(unsubscribe$)) .subscribe(setValue); return () => { unsubscribe$.next(); unsubscribe$.complete(); }; // eslint-disable-next-line react-hooks/exhaustive-deps }, []);
it('should be able to clear it\'s data', inject([SendPageDataService], (service: SendPageDataService) => { this.blankBundle = service.dataBundle service.dataBundle = this.testDataBundle //fill with data spyOn(service.dataSubject, 'next').and.stub() service.clearData(true) expect(service.dataBundle).toEqual({errors: []}) expect(service.dataSubject.next).toHaveBeenCalledWith(service.dataBundle) }));
ngOnDestroy() { this.ngUnsubscribe$.next(); this.ngUnsubscribe$.complete(); }
_redisConnection.on('message', function(channel, message) { const msg = `Message ${message} on channel ${channel} arrived!`; typeof callback === 'function' && callback.call(null, msg); _wsMessage.next(msg); });
it('should pass data into the dataSubject', inject([SendPageDataService], (service: SendPageDataService) => { spyOn(service.dataSubject, 'next').and.stub() service.dataBundle = this.testDataBundle service.dataStored = false service.getData() expect(service.dataSubject.next).not.toHaveBeenCalled() service.dataStored = true service.getData() expect(service.dataSubject.next).toHaveBeenCalledWith(service.dataBundle) }));
setDataStatus(isSet: string): void { this.dataStatus = isSet this.dataSetSubject.next(this.dataStatus) }
announceFeatureSelected(feature: FeatureModel){ if(feature){ this.featureIdSelected = feature._id; } else { this.featureIdSelected = null; } this.selectedFeature.next(feature); }
doSearch(text) { this.searchValue = text; this.search$.next(text); // The text value is not used but is needed for distinctUntilChaged }
announceSuiteSelected(suite: SuiteModel){ if(suite){ this.suiteIdSelected = suite._id; } else { this.suiteIdSelected = null; } this.announceFeatureSelected(null); this.selectedSuite.next(suite); }
// clear alerts function clear(id = defaultId) { alertSubject.next({ id }); }
announceProjectSelected(project: ProjectModel){ if(project){ this.projectIdSelected = project._id; } else { this.projectIdSelected = null; } this.announceSuiteSelected(null); this.selectedProject.next(project); }