Skip to content

12.什么是响应式编程? #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
webVueBlog opened this issue Mar 10, 2020 · 0 comments
Open

12.什么是响应式编程? #12

webVueBlog opened this issue Mar 10, 2020 · 0 comments
Labels
JavaScript JavaScript

Comments

@webVueBlog
Copy link
Member

In computing, reactive programming is a programming paradigm oriented around data flows and the propagation of change.

What is responsive programming

Responsive programming is a programming paradigm for data flow and change propagation. This means that static or dynamic data streams can be easily expressed in a programming language, and the associated computational model automatically propagates the changing values through the data stream.

For example, in imperative programming environments, a=b+c means that the result of the expression is assigned to a, and that later changing the value of b or c does not affect a. But in reactive programming, the value of a is updated as b or c is updated.
A spreadsheet program is an example of responsive programming. A cell can contain a literal value or a formula like "=B1+C1", and the value of the cell containing the formula will vary according to the value of the other cells.

Responsive programming was originally proposed to simplify the creation of interactive user interfaces and the rendering of real-time system animation, but it is essentially a universal programming paradigm.

什么是响应式编程

  响应式编程是一种面向数据流和变化传播的编程范式。这意味着可以在编程语言中很方便地表达静态或动态的数据流,而相关的计算模型会自动将变化的值通过数据流进行传播。

  例如,在命令式编程环境中,a=b+c表示将表达式的结果赋给a,而之后改变b或c的值不会影响a。但在响应式编程中,a的值会随着b或c的更新而更新。

电子表格程序就是响应式编程的一个例子。单元格可以包含字面值或类似"=B1+C1"的公式,而包含公式的单元格的值会依据其他单元格的值的变化而变化。

  响应式编程最初是为了简化交互式用户界面的创建和实时系统动画的绘制而提出来的一种方法,但它本质上是一种通用的编程范式。

@webVueBlog webVueBlog added the JavaScript JavaScript label Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JavaScript JavaScript
Projects
None yet
Development

No branches or pull requests

1 participant