您好我需要从rxjs
键入check my emit / subscribe functions我的类型:
type dataType = {|
name: string,
lastName: string,
country: string,
city: string,
email: string,
phone: string,
comments: string,
|}
我的观察:
Rx.Observable
.fromEvent(this.submitEmitter, 'press')
.throttleTime(1000)
.subscribe((data: dataType) => this.doSubmit(data))
;
我的发射器:
this.submitEmitter.emit('press', {
name,
lastName,
country,
city,
email,
phone,
comments,
});
如果我从emit函数中使用的有效负载中删除任何成员,则flowjs不会抱怨这一点。