- Mastering Reactive JavaScript
- Erich de Souza Oliveira
- 265字
- 2021-07-09 20:33:06
Reacting for the First Time
In the previous chapter, you started understanding the motivations behind using functional reactive programming in your systems; you also saw how a program using this paradigm fared against a program without it. You learned how reactive programming can improve code readability and testability by decoupling your event sources from the action you take when the action occurs.
We started with some basic examples using bacon.js as the reactive programming library for JavaScript. In the examples, we began with creating our first EventStream from an interval. Then we started using some operators (map() and take()). Finally, we subscribed to this event source to take actions in the case of an event occurrence. This was just a kind introduction to functional reactive programming.
When reading most of the functional reactive programming libraries (for any language), you will see a lot of diagrams explaining how the operator works. In the previous chapter, I presented the following diagram to illustrate a filter function:

We will cover what this illustration means in detail in this chapter. Learning how to read this will make reading documentation on libraries a lot easier.
Functional reactive programming is a paradigm which is hard to master, so after the quick introduction, you'll now move on to learning how to implement more complex programs using the bacon.js library.
This chapter will cover the following points:
- Understanding bacon.js observable objects (EventStream and Property) and their differences
- Modeling a functional reactive program
- Subscribing to an observable
- Unsubscribing from an observable
- Reading a reactive programming operator diagram
- Using operators to transform an observable
- 操作系統(tǒng)實(shí)用教程(Linux版)
- Kali Linux滲透測(cè)試全流程詳解
- 無(wú)蘋果不生活 OS X Mountain Lion隨身寶典
- Python基礎(chǔ)教程(第3版)
- macOS效率手冊(cè)
- 新手學(xué)電腦從入門到精通(Windows 10+Office 2016版)
- Dreamweaver CS5.5 Mobile and Web Development with HTML5,CSS3,and jQuery
- ElasticSearch Cookbook
- Cassandra 3.x High Availability(Second Edition)
- Windows 8實(shí)戰(zhàn)從入門到精通(超值版)
- CentOS 6 Linux Server Cookbook
- Ubuntu Linux操作系統(tǒng)實(shí)用教程
- Getting Started with UDK
- 計(jì)算機(jī)應(yīng)用基礎(chǔ)(Windows 7+Office 2010)
- Hyper-V Replica Essentials