扩展typescript中的___=___;语法
我最近看到了这种语法 通用参数默认值 逐个检查了所有版本,发现这是在版本2.3中添加的 它指定扩展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:
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.