16352 views In this new series we focus on operators for Reactive Programming. They are essential to react to data in your application. 1 – Introduction to Event Streams 2 – Transformation Operator Map The map operator is a common way of transforming values emitted over time. In the following example, it passes each value through a transformation function “colored to black & white“: 3 – Horizontal Combination Operator Scan Like map, the scan operator applies a function to a stream of values: an accumulator function. It also takes a second seed argument, the initial accumulator value: 4 – Time Shift Operator Delay Map and scan take a transformation function as a parameter. On the other hand, the delay operator takes a number of milliseconds. It time shifts each event by this amount of time: 5 – Vertical Combination Operator Zip Scan combines horizontally the events of a single event stream. On the other hand, zip combines vertically the events of multiple event streams. It takes the n-th color and n-th shape to produce the n-th coloredShape: 6 – Vertical Combination Operator CombineLatest Similarly to zip, combineLatest merges the events of multiple event streams. But whenever any event stream emits a value, combineLatest computes a new coloredShape using the latest color and the latest shape: A new animated series will start soon. Follow us to catch it! Click to share on Facebook (Opens in new window)Click to share on Twitter (Opens in new window)Click to share on LinkedIn (Opens in new window)
4 Comments on “Reactive Programming Operators” Pingback: Reactive Programming Operators (update 02/16) - ReactJS News Jan Mewes (@Janux_DE) says: February 19, 2017 at 10:24 am Those animations are pretty nice. Can you please tell me with which tool you created them? Reply Cédric Soulas says: February 19, 2017 at 11:53 am Thank you very much! I created the animations with After Effects 🙂 Reply Abdellah SELASSI (@selassiabdellah) says: July 21, 2017 at 4:19 pm Very Nice! Reply Leave a Reply Cancel reply