Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The functional reactive nature of Marble.js

The functional reactive nature of Marble.js

Reactive programming is not just a buzzword but nowadays is a de facto standard for building web apps on the frontend. On the Node.js, the concept is still not so popular as we might think. During the lecture I'll try to present the functional reactive programming paradigm in the JS world, not hiding behind the famous "monadic topic". Next I will present the main idea and examples of usage in the Marble.js framework.

Avatar for Józef Flakus

Józef Flakus

March 27, 2019

Other Decks in Programming

Transcript

  1. λ

  2. @JOZFLAKUS Immutability const x = { foo: ‘bar’ } const

    y = x X.foo = ‘baz’ y.foo === #3
  3. @JOZFLAKUS add :: Number -> Number -> Number ----------------------------------- const

    add = x => y => x + y ----------------------------------- const sum = add(2)(3) First-class functions #4
  4. @JOZFLAKUS const length = ([x, ...xs], len = 0) =>

    def(x) ? length(xs, len + 1) : len Recursion #5
  5. @JOZFLAKUS … and you can do with streams whatever you

    imagine 1 2 3 map(x => 10 * x) 10 20 30
  6. @JOZFLAKUS Sometimes, the elegant implementation is just a function. Not

    a method. Not a class. Just a function. ~ John Carmack >