Fork me on GitHub

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...


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


Hey @genekim, welcome to the channel!


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