函数名末尾的 $ 符号表示什么? [英] What does $ sign at the end of function name indicate?
本文介绍了函数名末尾的 $ 符号表示什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我正在审查的代码...
Here is the code I'm reviewing...
import { Observable } from 'rxjs/Rx';
// reducer
import { playerRegister, PlayerState } from './player';
export function getPlayer$ (state$: Observable<MyAppState>): Observable<PlayerState> {
return state$.select(state => state.player);
};
推荐答案
在语法上,美元 ($
) 字符在 JavaScript 标识符.
Syntactically, the dollar ($
) character has no special meaning in JavaScript identifiers.
然而,有时按照惯例使用它来表示一个变量包含一个 Observable
或者一个函数将返回一个 Observable
.
It is, however, sometimes used by convention to indicate that a variable holds an Observable
or that a function will return an Observable
.
这篇关于函数名末尾的 $ 符号表示什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文