本文整理汇总了TypeScript中rxjs/Subject.Subject.complete方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Subject.complete方法的具体用法?TypeScript Subject.complete怎么用?TypeScript Subject.complete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rxjs/Subject.Subject
的用法示例。
在下文中一共展示了Subject.complete方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: switch
message: (message) => {
console.debug('Received from server the following : ', message['data']['data']);
const communication: ServerCommunication = message['data']['data'];
switch(communication['type']){
case 'question':
this._questions.next(communication);
break;
case 'notification':
console.log('received a notif');
this._notifs.next(communication);
break;
case 'scores':
this._scores.next(communication['content']);
break;
case 'complete':
this._questions.complete();
break;
default:
console.log('Type of the communication unknown');
break;
}
},
示例2: setTimeout
setTimeout(() => {
UserMock.firstName = user.firstName;
UserMock.lastName = user.lastName;
UserMock.email = user.email;
subject.next(UserMock);
subject.complete();
}, 1000);
示例3: it
it('should wait for all observables to complete and then provide their final values', () => {
const subject1 = new Subject<string>();
const subject2 = new Subject<string>();
const observable = Observable.forkJoin(subject1, subject2);
const log = [];
observable.subscribe(next => log.push(next));
subject1.next('hello');
expect(log).toEqual([]);
subject2.next('world');
expect(log).toEqual([]);
subject1.complete();
expect(log).toEqual([]);
subject2.complete();
expect(log).toEqual([['hello', 'world']]);
});
示例4: isAuto
let subscription = timer.subscribe(() => {
let meteorUser = Meteor.user();
if (meteorUser) {
subject.next( LoginActions.loginSuccessFactory(
this.userFromMeteorUser(meteorUser),
meteorUser._id,
isAuto(lastLoginState)
));
subject.complete();
subscription.unsubscribe();
}
});
示例5: afterEach
afterEach(function() {
routeSet$.complete();
});
示例7: afterEach
afterEach(function() {
routerInstruction$.complete();
});
示例8:
this.image.onload = () => {
this.imageLoadSubject.next(null);
this.imageLoadSubject.complete();
};