Fork me on GitHub
#om
<
2015-06-30
>
jamiei08:06:36

Hi all, I'm wondering how I can get at a secretary destructured route map within an om component, I've contrived a rough sketch of some code to illustrate (http://pastebin.com/JHgMZQx8). If I wanted to load the data for the id presented in the url, would I need to use shared state to communicate which id is being viewed to the component view or is there a better way?

sander09:06:19

@jamiei: i think om’s advanced tutorial lists some ways to share state

jamiei09:06:18

@sander: But is sharing state the idiomatic way to approach this?

jamiei09:06:34

Shared state between a router and the app?

sander09:06:52

@jamiei: not sure if an idiomatic way has been established. i use bidi myself, and keep an up-to-date :route map in my app-state

jamiei09:06:25

@sander: Got it, thanks, will have a look at bidi.

sander09:06:11

jamiei: no need to switch horses simple_smile i use something similar to https://github.com/sander/precook/blob/master/src/precook/om_helpers.cljs now to keep app state up-to-date