article

Reactive Programming in JavaScript (funjs London, April 2014)

I gave a presentation on Reactive Programming in JavaScript at FunctionalJS London on 28th April 2014.

To describe reactive programming, I like to think of the key concepts of functional programming (using values and functional composition to solve problems in a declarative style) applied to real-world constraints such as async, mutable state and UIs.

The main idea behind reactive programming is that of “data types that represent values over time”. Because they are values (rather than side-effecting callbacks, for instance), they can be passed around and composed like any value, abstracting away the execution flow into declarative expressions.

For UIs, data-bindings provide a declarative mean to bind values (either plain values or reactive “observables”) to the view.

It applies to the Web, of course, but not exclusively; the build tool I work on, Plumber, is also based on the Highland reactive library.

For a deeper introduction, have a look at the presentation slides.

The talk was followed by a dojo, through which the participants could experiment with the concepts I presented using real code. The two tasks offered were a simple search UI for Guardian content using BaconJS, and new operations to analyse file sizes and gzip files for the Plumber build system.

You can still have a go at the dojo yourself if you fancy it!

And if you want to dig more in the subject of reactive programming, have a look at the reference index at the root of the presentation repository.

Leave a Reply

Your email address will not be published. Required fields are marked *