-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] [#21] Work around issue with use in Cljs
core.async/go
bodies
Problem: (clojure.core.async/go (taoensso.telemere/log! "hello")) ; Compiles fine (cljs.core.async/go (taoensso.telemere/log! "hello")) ; Compile fails I could try to get to the bottom of exactly what's going on - but ultimately IOC mechanisms like `go` are always going to be a bit fragile, especially for heavily-optimized/unusual code. In this case, the problem is thankfully only with Cljs - and Telemere's Cljs performance isn't too critical - so I think we can afford to just bypass any potential fiddling by the `go` macro by wrapping Cljs Telemere expansions in an IIFE ((fn [] ...)). Downside is the (small) added cost of a function construction and call. Upside is avoiding potential issues with core.async and other similar IOC-style systems (Electric Clojure, etc.)
- Loading branch information
1 parent
568906c
commit cbab57b
Showing
3 changed files
with
47 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters