我实际上已经困惑了几天,最后决定提出这个问题。
facebook 团队在 React 上使用这种代码风格 & Immutable pages 。有人可以解释一下如何阅读这些内容吗?
以下是链接页面中的代码副本:
List.of<T>(...values: T[]): List<T>
我们应该如何阅读这篇文章?
最佳答案
这个-
List.of<T>(...values: T[]): List<T>
意味着这个 -
The function List.of<any type>(takes one or more items of that type) : and returns a List<of that type>.
他们文档中的另一个例子 -
update(index: number, notSetValue: T, updater: (value: T) => T): List<T>
意味着这个 -
The function update(takes index, which is a number, notSetValue which is of any type, and updater which is a function (which takes in value of that type) => and returns that type) and returns a List of that type.
关于javascript - 如何阅读 Immutable/React 文档页面的代码示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36132404/