Fork me on GitHub
#untangled
<
2016-12-13
>
Ian Chow04:12:03

here’s what i came up with fwiw. uses load-field and appears to work so far. https://gist.github.com/ianchow/43143a8134670eb8dc5a8133f7c75aa8

tony.kay05:12:17

@ianchow looks like it might work. I’d tend to want to isolate the implementation from the UI, so having core async involved is somewhat undesirable here. You are allowed to keep the top-level app (and therefore the reconciler) in some kind of global. Setting some kind of timeout (say, an interval timer you debounce) that runs a load via the reconciler is more what I’d recommend. Then, your mutations on the UI events can be completely detached from the implementation of fetch/rerender: the mutations themselves hit the debounced timer, and when the timer goes off it can send off the load via the reconciler.

tony.kay05:12:20

if you still want to use core async that’s fine…I just wouldn’t mix it in with the nice pure UI rendering and certainly would be worried about combining it with local state. That said, I’d be tempted to use local state for the highlighting for speed in larger apps 🙂