Fork me on GitHub

Thanks to Eric's tutorial, it looks like re-frame is (just) on the front page of Hacker News


one question about re-com, for splits mouseout doesn't work if i drag to outside the browser window while dragging?


because if i release mouse outside and return it back, splits still dragging but mouse is up


oh ok it's not only outside the browser window, it works the same outside html container


there is no release outside


or something like that


@kenny related to your question here: I was just looking for the same thing (I didn't notice that somebody would reply - please correct me If I am wrong). Currently, I am using the add-watch function. You can see it here: Where I compare old :components with new ones and in case of change I update index for search and trigger event taking new value into account (during current search/filtering). I guess you didn't come up with something better meanwhile?


@nenadalm can you confirm your usecase a bit more? Sounds like you: 1. want to monitor some paths (x and y) within app-db, and ... 2. when the value at x or y changes, .... 3. dispatch some event Is that it?


If so, does the need to monitor x and y come and go? Or does this need last for the entire life of the app.


I have to go to bed but ... using reagent's track might work ...

(defonce tracking-x-y reagent.core/track
  (fn [] 
     (let  [x-val  @(re-frame.core/subscribe [:query-x])
            y-val @(re-frame.core/subscribe [:query-y])]
        (re-frame.core/dispatch [:something changed x-val y-val]))))
Ie. an event will get dispatch each time either subscription fires.


@mikethompson thanks. That seems to be what I was looking for. The use case you described is exactly what I want (+ some of the values aren't paths but are computed in subscriptions). The need lasts for entire life of the app. Use case is that I have text filter which filters some items of list. User can change the list by adding/changing items by using 4 handlers (after confirmation, added/edited item should stay visible only if it matches the filter). Another use case might be in an infinite scroll for the list I am currently thinking about. (Total number of records will have to be changed whenever visible items changes (visible items are computed using subscription using all items + filter value - but this will probably somehow change after I'll store data more efficiently. Currently they're all in local storage under 1 key - fine for my use cases for now...).


so suppose I want to integrate some external js into my page


for example Stripe or google maps


what's the general process to do that?


for Stripe I simply there was something like

<form> <script data-s.... </script> </form>


and I just rewritten everything in hiccup style


for google maps I even found some clojurescript snippets around using reagent for example


so well I just wonder how people proceed, since I've never really done it so far