最近,当我使用Rxjs 5时,我通过使用npm install Rxjs@5.0.1从node_modules下的下载代码中下载了Rxjs,在Rxjs文件夹中找到了Observable.d.ts,我看到它声明了它的构造函数,如下所示:
*
* @constructor
* @param {Function} subscribe the function that is called when the Observable is
* initially subscribed to. This function is given a Subscriber, to which new values
* can be `next`ed, or an `error` method can be called to raise an error, or
* `complete` can be called to notify of a successful completion.
*/
constructor(subscribe?: <R>(this: Observable<T>, subscriber: Subscriber<R>) => TeardownLogic);
Run Code Online (Sandbox Code Playgroud)
我的问题是:在subscribe的函数类型声明中此关键字的用法是什么?:(此:Observable,...),TypeScript是否有一些有关此关键字用法的文档?谢谢。