Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
扩展typescript中的___=___;语法_Typescript - Fatal编程技术网

扩展typescript中的___=___;语法

扩展typescript中的___=___;语法,typescript,Typescript,我最近看到了这种语法 通用参数默认值 逐个检查了所有版本,发现这是在版本2.3中添加的 它指定V的默认类型。因此V可以是扩展Action的类,或者如果未提及,则属于Action类型 export interface ActionReducer<T, V extends Action = Action> { (state: T | undefined, action: V): T; } node_modules/@ngrx/store/src/models.d.ts:6:52:

我最近看到了这种语法

通用参数默认值 逐个检查了所有版本,发现这是在版本2.3中添加的 它指定
V
的默认类型。因此
V
可以是扩展
Action
的类,或者如果未提及,则属于Action类型

export interface ActionReducer<T, V extends Action = Action> {
  (state: T | undefined, action: V): T;
}
node_modules/@ngrx/store/src/models.d.ts:6:52: ',' expected.