本文整理匯總了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();
};