Fork me on GitHub
#clojuredesign-podcast
<
2019-07-19
>
nate03:07:17

Checking out the code now.

nate03:07:05

What we usually do is have the fake switch out happen on the server side.

nate04:07:36

We use component to stitch together our applications, using code something like this:

(defn new-system
  [config]
  (let [{:keys [fake-mode]} config]
    (component/system-map
      :twitter (if fake-mode (fake-twitter/component config) (twitter/component config))
      :poster (component/using (poster/component config) [:twitter])
      :web (component/using (web/component config) [:poster]))))

nate04:07:51

Then the frontend always connects to the server

nate04:07:27

Switching things out for fake data on the frontend is a neat idea, though

nate04:07:44

It would let you rev on the frontend without having the backend present at all

nate04:07:25

Thanks for sharing the code, let me know if you have any other questions

nate04:07:50

And thank you for your kind words, I'm super happy to be part of something that's useful

genekim18:07:54

🤯🤯 So awesome!!! Thank you!!! I'll study this later today and let you know how it works out! @nate

👍 4