Edd Mann Developer

Implementing a Cancelable Promise in JavaScript

I recently was working on a React component which complained about its state being set when it was not mounted. This was due to a uncompleted promise being resolved when the component had since been unmounted. To solve this issue I was able to use the concept of a cancelable promise which would be canceled before the component was unmounted.

Implementing Promise.all and Promise.race in JavaScript

Throughout the past couple of months much of the JavaScript development I have been involved with has revolved around Promises. Promises are a simple abstraction to handle deferred and asynchronous computations. This lunchtime I decided to see how one would go about implementing two concepts that are present in the Promise standard (all and race).

Exploring Multi-Methods in Clojure

Currently reading through the Joy of Clojure book I have recently been introduced to Clojure’s multi-method support. I decided that it would be interesting to see this feature in action, so I opened up LightTable and codified some example use-cases.

Binary Search Trees in Clojure

This weekend I was able to spend some more time exploring Clojure. I decided that it would be interesting to reimplement some of the Binary Search Tree work I had previously done in PHP. We start by creating a simple record definition which describes the contents of a Node.