javascript - 如何阅读 Immutable/React 文档页面的代码示例

标签 javascript facebook syntax reactjs immutable.js

我实际上已经困惑了几天,最后决定提出这个问题。

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/

相关文章:

java - Java 的 lambda 语法的分割是什么?

Python:从子类更改父类属性

javascript Node.js 异步等待电子

javascript - Canvas 旋转未按预期工作

php - Facebook API : Can it access "notes"?

android - 当我使用 Samsung Android 4.2 时,Facebook 登录不起作用

iphone - 我应该针对我的下一个iPhone应用程序定位哪个iOS版本(考虑到Facebook集成)

c - c 中带有 double 的函数有不同的语法吗?

javascript - 在背景图像上滑动效果

javascript - Braintree 的 Sandbox PayPal 集成(使用 JS 和 PHP)