aphyr / dom-top

Unorthodox control flow, for Clojurists with masochistic sensibilities.
Eclipse Public License 1.0
202 stars 8 forks source link

Do you accept a patch to make this library work for ClojureScript? #2

Open lucywang000 opened 2 years ago

lucywang000 commented 2 years ago

Hey, thanks for a lot for this library. I find the letr and loopr not only useful in clj, but also in cljs. It improves the readability of some code quite a bit. Would you be willing to accept a PR for adding cljs support?

I think it would basically involves these changes:

  1. make the macros in src/core.clj file able to generate cljs-specific code, e.g. IllegalArgumentException for clj and js/Error for cljs. Also the :via :iterator specific code could use the js Symbol.Iterator protocol.
  2. make the test/core.clj file into .cljc format, and use reader conditionals to only execute threadpool related code (bounded-pmap etc.) in clj.
lucywang000 commented 2 years ago

Here it is #3 :)