This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-09
Channels
- # aleph (4)
- # beginners (31)
- # boot (33)
- # cider (7)
- # cljs-dev (263)
- # cljsrn (1)
- # clojure (33)
- # clojure-austin (2)
- # clojure-dev (1)
- # clojure-russia (6)
- # clojure-spec (19)
- # clojure-uk (7)
- # clojurescript (79)
- # cursive (21)
- # datascript (1)
- # datomic (13)
- # dirac (12)
- # emacs (15)
- # hoplon (26)
- # lein-figwheel (3)
- # leiningen (1)
- # luminus (5)
- # lumo (20)
- # mount (1)
- # off-topic (17)
- # om (13)
- # onyx (24)
- # parinfer (70)
- # pedestal (2)
- # re-frame (19)
- # reagent (1)
- # ring-swagger (3)
- # unrepl (8)
- # untangled (58)
- # yada (2)
Thanks to Eric's tutorial, it looks like re-frame is (just) on the front page of Hacker News https://news.ycombinator.com/item?id=14725114
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
https://github.com/Day8/re-com/blob/master/src/re_com/splits.cljs#L79 looks like this condition never works
@kenny related to your question here: https://clojurians-log.clojureverse.org/re-frame/2017-03-08.html#inst-2017-03-08T02:29:30.007278Z. 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: https://github.com/nenadalm/Warehouse/blob/9dd3fb332cf75751c7ec6604697affe78d4a416f/frontend/src/warehouse/index.cljs#L17. 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