clojuredesign-podcast

Discussions around the Functional Design in Clojure podcast - https://clojuredesign.club/
genekim 2019-07-18T20:06:32.030800Z

Hello, @neumann @nate — I’m loving your fabulous podcast. Your episode on fakes inspired me, and I finally got around to trying to build one for a ClojureScript app that talks to the Trello API (via a Clojure web server). I managed to build a couple of commands for a ServerTrello and FakeTrello interface, and now I’m wondering how you typically tell the app whether you want it to hit the real server, or the fake server? I ended up setting a global JS variable called fake, which I read in my CLJS app, and then use it to set a var to either the fake or real, umm.. what do you even call it... Interface? Protocol? Do you have any advice on how to do this better? Many thanks in advance!!! And keep up the great work! PS: I now realize I should be using a case instead of a cond, and will likely make more interfaces so I can pull them out of that ugly switch expression — I had forgotten that I wrapped some of my Trello server calls in a go block... https://gist.github.com/realgenekim/4375188bba08300612b1e00b62f6555e#file-trello_interfaces-cljs-L131

genekim 2019-07-18T20:06:33.030900Z

(Oof. Cringing at that awful def inside of a defn, but it worked... :)

nate 2019-07-18T20:54:31.032200Z

Hey @genekim, welcome to the channel!

nate 2019-07-18T20:55:02.033100Z

I'm not at a computer right now, but I will be later. I'll check out the code and respond then.