Fork me on GitHub
#om
<
2015-09-15
>
dnolen13:09:39

starting to see the light at the end of tunnel, finally writing tests for Om Next which means maybe I actually have a design ...

mattly18:09:57

given a sub-cursor in a sub-component of the root, is there a way to get the root cursor? I assumed that was what om/root-cursor was for but apparently I misread

afhammad18:09:02

@mattly: isn’t the root always the app-state?

mattly18:09:54

yes, but that wasn’t what I asked – I have a sub-cursor

mattly18:09:35

which from a bit of digging in the repl is basically the root with a “path” that provides a lens for the value

mattly18:09:20

maybe this isn’t best practice, but you can at least get to the underlying atom with om/state

mattly18:09:07

the basic idea is that i want to get at the csrf token without having to pass that value around separately or specify it everywhere it might be needed

afhammad18:09:37

how about shared state?

mattly18:09:02

right now the generator for the hidden field is in a function

mattly18:09:11

maybe it’ll be a component sooner or later

mattly18:09:23

but it gets the cursor, not the owner

afhammad18:09:31

afaik the only non-hacky/global state approaches are ref-curors and shared state, but both would require you to pass an additional argument to that function