This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-21
Channels
- # arachne (21)
- # beginners (22)
- # boot (58)
- # cider (27)
- # cljs-dev (67)
- # cljsjs (10)
- # cljsrn (13)
- # clojure (91)
- # clojure-greece (6)
- # clojure-russia (1)
- # clojure-uk (6)
- # clojurescript (6)
- # core-async (3)
- # cursive (6)
- # datomic (3)
- # events (2)
- # hoplon (152)
- # off-topic (44)
- # om (8)
- # om-next (7)
- # onyx (16)
- # protorepl (10)
- # re-frame (10)
- # reagent (22)
- # untangled (5)
Hey all, having trouble adapting a particular use case to re-frame, maybe you can help. I wrote an interceptor for :active-panel
changes that checks if the user is authenticated. if they aren't, i force navigate!
(via accountant) to the login page. So far so good. Then I added the ability to add alerts to the DB so i could let them know, hey, you gotta login before going to that page. However, I cannot figure out how to clear the alerts before/after a given panel change (so they don't just stack up in the UI forever) without making them disappear from the active panel, since I subscribe
to that key in the DB.
I did briefly use :dispatch-later
to give the user 30 seconds or so to read the alert before removing it, but that is sub-optimal and its sudden removal from the DOM shifted things around too much for my taste. The best analogy I can come up with is when you do a traditional server-side POST, there's some issue, you render the template again with the errors visible, but they don't carry over to other pages or even when hitting refresh on that page.
(with my mental picture being a red bar at the bottom of the screen floating above the rest of the content
Yeah, I suppose at that point I might as well just use something like toastr and have it live entirely separate rather than implement the fading and timing stuff myself
Hi. Is it a good idea to use (dereference) subscriptions inside event handlers? I would like to do this to avoid duplication computations for values which already have been computed (and cached) in the subscription. Or am I totally wrong here?
For example I have a computation intensive subscription :favorite-items
. I also have an event :do-something-with-favorite-items
. Do I have to recompute the list of favorite items from db in the event handler again? Or can I use the subscription inside my event handler and ignore the provided db?
@mikethompson: thanks for the advice, we found a great reagent tutorial on lambdaisland, building a simple Kanban board. We will do some background reading on re-frame and work on that next