While working with ClojureScript immutable data sources is great inside Clojure land, most
of the Javascript Ecosystem is designed and optimized to work around JSON. For example,
if you want store data in the IndexedDB
on the browser, the documents that you store must be JSON objects.
You could try to go around this by having a object with a single key that has the EDN
encoded as string (or maybe transit?), but if you do so, you can’t leverage the IndexedDB
indexes, that expect json structures to work upon.
There is the standard clj→js
, but it has some problems:
-
it loses keyword namespaces data
-
types are constrained by JSON (loses type information for UUID’s, dates, etc…)
This library tries to address this problem by making an opinionated encoder/decoder, by
taking some arbitrary decisions (and sticking to them) we can send and recover this data.