I'm still having problems comprehending Reactive Programming. Thanks in advance for the help. :)
For further actions, you may consider blocking this person and/or reporting abuse
I'm still having problems comprehending Reactive Programming. Thanks in advance for the help. :)
For further actions, you may consider blocking this person and/or reporting abuse
Víctor Falcón -
quantotius -
Roman Tsegelskyi -
arinak1017 -
Top comments (6)
Reactive programming is like the infamous "marble course" we all loved to play with as kids:
Instead of dictating what your code should do RIGHT NOW (procedural programming), you define what may happen in response to a certain set of events, like where you may have several "entry pipes" in your marble course!.
Nailed it!
Awesome! Thanks!
Imagine walking into coffee shop and ordering a cappuccino. The barista takes your order and starts making the coffee. Other customers wait patiently behind you in line till your coffee is prepared and you pay. The barista then deals with the next customer. This is imperative style coding.
Now, imagine walking into a coffee shop and ordering a cappuccino. The barista takes your order and hands you a token. He shouts to his minions saying "Token 42, Cappuccino, no sugar". You are asked to wait comfortably on a couch. The barista then deals with the next customer. Whenever your coffee is ready, he shouts "Token 42, Cappuccino, no sugar, ready!". You show your token, pick up the coffee and walk out. Other customers do the same. That's reactive programming. You reacted to a set of events and didn't wait till a process was complete.
If you've ever made a formula in Excel, you've done reactive programming.
If you put
=A1+B1
in the cellC1
, you're saying you wantC1
to be updated every timeA1
orB1
is updated. That's also what you do in reactive programming.Or, in other words: this value is based on changes from these other values.
Reactive Programming Basics - adding of two numbers
youtu.be/EgWwEakQWjk
dev.to/muthuishere/reactive-progra...