Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambdas for cljs #14

Open
shen-tian opened this issue Dec 19, 2019 · 2 comments · May be fixed by #19
Open

Lambdas for cljs #14

shen-tian opened this issue Dec 19, 2019 · 2 comments · May be fixed by #19

Comments

@shen-tian
Copy link

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?

@fotoetienne
Copy link
Owner

It probably works. I just wasn't able to get the lambda spec tests to pass due to missing load-string in cljs

;; Unable to load the labdas in cljs due to eval issues

@fotoetienne
Copy link
Owner

fotoetienne commented Jan 4, 2020

Kudos to anyone who can get the lambda tests working in cljs!

iarenaza added a commit to biotz/cljstache that referenced this issue Dec 5, 2021
@iarenaza iarenaza linked a pull request Dec 7, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants