Liking cljdoc? Tell your friends :D
All platforms.

cli-matic.platform-macros

Macros shared between CLJ and CLJS.

Unfortunately:

  • Macros must be in a separate file (for CLJS)
  • Macros have a different import syntax (CLJS)
  • Macros defined in .clj will STILL be loaded by CLJS and will fail big time.

So we have to use a separate namespace and hide everything behind reader conditionals.

Usage is:

#?(:clj [cli-matic.platform-macros :refer [try-catch-all]]

:cljs [cli-matic.platform-macros :refer-macros [try-catch-all]] )

This was a real PITA, man.

## Macros shared between CLJ and CLJS.

Unfortunately:

- Macros must be in a separate file (for CLJS)
- Macros have a different import syntax (CLJS)
- Macros defined in .clj  will STILL be loaded by CLJS and will fail big time.

So we have to use a separate namespace and hide everything behind reader conditionals.

Usage is:

#?(:clj [cli-matic.platform-macros :refer [try-catch-all]]

   :cljs [cli-matic.platform-macros :refer-macros [try-catch-all]]
             )

This was a real PITA, man.

raw docstring

try-catch-allclj/s≠macro

(try-catch-all f onErr)
clj

This creates a try-catch block that either traps Throwable on the JVM or :default on Node.

Use:

(try-catch-all (/ 1 0) (fn [x] 0))

So both expressions must be surrounded by round parentheses.

This creates a try-catch block that either traps
Throwable on the JVM or :default on Node.

Use:

`(try-catch-all (/ 1 0) (fn [x] 0))`

So both expressions must be surrounded by round parentheses.
cljs

See the .clj docs.

See the .clj docs.
source (clj)source (cljs)raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close