Fork me on GitHub
#om
<
2017-03-30
>
sova-soars-the-sora16:03:48

Hi Everyone! Happy #\Clojurewest!

sova-soars-the-sora16:03:28

I have a collection of submissions and I want to re-arrange their order of display on the page.

sova-soars-the-sora16:03:56

I have an action that should sort them, but when I do (take 8 ~) of my collection, I get the same 8 everytime

sova-soars-the-sora16:03:20

they live in an atom

sova-soars-the-sora16:03:28

so far my best guess is: maybe my sort is not doing what I think it's doing

sova-soars-the-sora16:03:28

(swap! nf-app-state-atom update :blurbs #(sort-by :number-of-ratings %))

sova-soars-the-sora16:03:04

Hrm. Maybe it's because the invokation happens before the atom is populated with info.

sova-soars-the-sora16:03:53

Okay, that appears to have been the issue.

sova-soars-the-sora16:03:16

Ah, that's the magic of the react lifecycle methods. sort the data to your liking on different lifecycle events....

sova-soars-the-sora16:03:26

like component will render or whatever

baptiste-from-paris20:03:54

hello guys, any feedbacks on how to handle routing server-side for om application ? (for example, I want to access the article /news/my-front-route/om-is-awesome