Fork me on GitHub
#re-frame
<
2016-07-04
>
javazquez18:07:58

Thanks @mccraigmccraig ! Any code example you can point me at? The sample todo app seems to use an atom https://github.com/Day8/re-frame/blob/master/examples/todomvc/src/todomvc/views.cljs#L7

mccraigmccraig18:07:45

@javazquez: ha, so it does. naughty! have a look further down though, at the checkboxes https://github.com/Day8/re-frame/blob/master/examples/todomvc/src/todomvc/views.cljs#L54 https://github.com/Day8/re-frame/blob/master/examples/todomvc/src/todomvc/views.cljs#L87 which are using respectively props and a sub for the value of the input, and dispatching on change

javazquez18:07:57

@mccraigmccraig: is there a need for debounce? If so, is there a common util that folks use.. if not I am fine rolling my own

mccraigmccraig18:07:53

what are you thinking of debouncing @javazquez ?

javazquez19:07:58

@mccraigmccraig: sorry for the cryptic question. I am looking at trying to implement Typeahead with a couple of the fields using an Ajax call to the server

mccraigmccraig19:07:59

ah, right, so you want a last-call-wins approach... i'm currently implementing something which will do that, but it's only partially complete. i don't know of a ready-to-go solution

lwhorton21:07:59

it looks like it’s my apps responsibility to not pass down anon functions inside of props to components if they shouldn’t rerender each frame, eh?

lwhorton21:07:43

[component {:call-back #(…)}] will rerender constantly, but [component {:call-back my-ns-fn}] wont. is there a more convenient way to avoid this issue?