type StoreCreator = (reducer: Reducer, preloadedState: ?State) => Store
我从来没有遇到过这个。什么类型的?
作为一个不相关的跟进,什么是 ?State
?
最佳答案
type
用于 typescript 中的类型别名。例如:
type StringOrNumber = string | number;
A type alias serves as an alias for the type specified in the type alias declaration. Unlike an interface declaration, which always introduces a named object type, a type alias declaration can introduce a name for any kind of type, including primitive, union, and intersection types.
在这里您可以找到文档:https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#3.10
关于javascript - 在通常放置 var 的地方使用 type 关键字是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38877424/