Flexibility Through Immutability, part 2: How and When?

The second part of the original text for “Flexibility Through Immutability“.

The first part focused on the why of immutable data. On this part I’ll review what to do about if you’re working on an object-oriented language.

Use namespaced keywords for events

Introduction

If you’re using re-frame as your pattern for single-page applications in ClojureScript (and why wouldn’t you?), then you are defining your events and handlers using keywords.

These are a prime example of when Clojure’s namespaced keywords come in handy.