Skip to content

Instantly share code, notes, and snippets.

@maltebucksch
Last active August 20, 2018 10:11
Show Gist options
  • Save maltebucksch/8a912635815f0ac90b6d3d4a0e398efe to your computer and use it in GitHub Desktop.
Save maltebucksch/8a912635815f0ac90b6d3d4a0e398efe to your computer and use it in GitHub Desktop.
// let’s say we have 2 variables
b = 1, c = 1
// and a third which is the sum of both
a := b + c
print(a)  // output wil be “2” (so far, so good)
// now let’s change the value of “c”
c = 2
print(a)
// in imperative programming: the output will be “2” (since "a" is not reassigned)
// in reactive programming: the output will be “3”! (since "a" is reacting to the change of “c”)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment