Fork me on GitHub
#om
<
2017-03-12
>
baptiste-from-paris15:03:17

hello all, little om.next question. How do you interact with an API you don’t control ?! Little use case, I am building a newsfeed from the New York Time API . My UI is quite simple, something like that =>

(def init-data {:news-feed [{:id 1
                             :title "This is a title"
                             :author {:id 3 :name "Baptiste"}}
                            {:id 2
                             :title "This is an other title"
                             :author {:id 4 :name "Vincent"}}]})
The nyt API send me back completly different fields (https://developer.nytimes.com/archive_api.json) . Should I map their API to my app-state on the front-end ? Should I write a back-end which deal with it ? Feedbacks are welcomed 🙂

levitanong16:03:45

@baptiste-from-paris That’s how I would do it, in the send function, before passing it to the callback.

levitanong16:03:55

*in the front-end

baptiste-from-paris16:03:40

ok, that’s what I am doing but it can become quite ugly

levitanong16:03:59

@baptiste-from-paris specter might help you shape your data

sova-soars-the-sora22:03:22

Hi. I'm interested in recursive queries and I want to do indented comments on entries. So a reply to a comment is indented one unit width. How can I ... make indentations cumulative, or do you recommend using list elements and styling via css that way?

dvingo23:03:13

could potentially use react virtualized