There’s one functional programming principle you ought to know, no matter which is your favorite programming paradigm. Surprisingly, it’s not a super-advanced, abstract, mathematical mischief. Rather, it is the most basic principle of functional programming.
Although simple, it is very powerful and I believe I write better code since I started using it as often as I can.
I remember learning redux a few years ago. It was the first time I heard the term “pure function”. I was hooked immediately. It all made perfect sense… Composition, immutability, pure functions, it all looked so elegant and just…right.
I started learning…
I believe the most confusing part, and the most important to understand, is the promise’s
then method. It is the main and most basic way of interacting with a promise.
In this article, I’ll try taking a different, more functional, approach to explain how the
then method actually works. …