Liking cljdoc? Tell your friends :D
All platforms.

cljs-lambda.macros


defgatewayclj/smacro

(defgateway name & body)

Variant of deflambda which uses cljs-lambda.aws.event to translate the first input and eventual output as maps describing API Gateway requests and responses. Does nothing to errors.

(defgateway echo [event ctx]
  {:status  200
   :headers {:content-type (-> event :headers :content-type)}
   :body    (event :body)})
Variant of [[deflambda]] which uses [[cljs-lambda.aws.event]] to translate the
  first input and eventual output as maps describing API Gateway requests and
  responses.  Does nothing to errors.

```clojure
(defgateway echo [event ctx]
  {:status  200
   :headers {:content-type (-> event :headers :content-type)}
   :body    (event :body)})
```
sourceraw docstring

deflambdaclj/smacro

(deflambda name & body)

Define exported var name with given bindings, interpreting body as per [[async-lambda-fn]].

If [[handle-errors]]-type behaviour is required, use async-lambda-fn directly.

(deflambda wait [{n :msecs} ctx]
  (p/delay n :waited))

;; Expands into

(def ^:export wait
  (async-lambda-fn
   (fn [{n :msecs} ctx]
     ...)))
Define exported var `name` with given `bindings`, interpreting `body` as
  per [[async-lambda-fn]].

  If [[handle-errors]]-type behaviour is required, use `async-lambda-fn`
  directly.

```clojure
(deflambda wait [{n :msecs} ctx]
  (p/delay n :waited))

;; Expands into

(def ^:export wait
  (async-lambda-fn
   (fn [{n :msecs} ctx]
     ...)))
```
sourceraw docstring

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

× close