Skip to content

Lambdas for cljs #14

@shen-tian

Description

@shen-tian

The readme says this only works in JVM, which I take to mean Clojure only. But based on some experiments, it seem to work fine for ClojureScript too:

(let [d {:text "hello"}]
    (render "Text is {{#uppercase}}{{ text }}{{/uppercase}} {{lambda}}"
            (merge d
                   {:uppercase (fn [x] (str/upper-case (mustache/render x d)))
                    :lambda (fn [] "from inside lambda!!")})))
;; => "Text is HELLO from inside lambda!!"

Is there some limitations I should be aware of? of is the doc just out of date?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions