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.
Following on from my article on Binary Search Trees last week, I decided to see how I could use types and interfaces to implement the glue that is required to make the Binary Tree implementation compatible with the clojure.lang.IPersistentSet interface.
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).
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.
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.