hi everybody!
I would like to create a middleware that works for Clojure and ClojureScript and I'm kind of lost. Let's say I want to write the current-time middleware described here https://nrepl.org/nrepl/design/middleware.html, but that will return (System/currentTimeMillis) if piggieback isn't present, but return (.getTime (js/Date.)) otherwise. Can the middleware op processing fn evaluate something on the JS runtime when piggieback is present?
Sorry for the slow response, but yeah - it's very tricky because you can't normally evaluate ClojureScript code, without piping things to piggieback's eval. That's why most of CIDER's functionality is Clojure-only.
just in case somebody else is interested in this I was able to make it work by copying what cider-inspect middleware does
I guess I'll need a way to know if piggieback is present down the road, and change the op to a eval with the code I want, then on the response path grab the output and do my transport/send ?