This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-05
Channels
- # beginners (29)
- # boot (29)
- # cider (54)
- # cljs-dev (99)
- # cljsjs (31)
- # cljsrn (39)
- # clojars (32)
- # clojure (171)
- # clojure-austin (2)
- # clojure-berlin (5)
- # clojure-brasil (3)
- # clojure-greece (2)
- # clojure-italy (1)
- # clojure-korea (11)
- # clojure-spec (202)
- # clojure-uk (166)
- # clojurescript (130)
- # cursive (54)
- # datomic (99)
- # dirac (18)
- # figwheel (6)
- # hoplon (23)
- # lambdaisland (3)
- # leiningen (8)
- # luminus (14)
- # off-topic (11)
- # om (3)
- # om-next (24)
- # onyx (59)
- # planck (25)
- # protorepl (10)
- # re-frame (49)
- # reagent (14)
- # ring-swagger (2)
- # rum (46)
- # schema (1)
- # slack-help (6)
- # specter (7)
- # testing (7)
- # untangled (115)
- # yada (1)
Is there any way to check an event has been registered?
@andrethehunter in re-frame.registrar/kind->id->handler
you can find all registered handlers
thanks for pointing me in the right direction, re-frame.registrar/get-handler
was exactly what I was after
@andrethehunter as Martin points out, you can reach into the impl to do a check. But no "offical' API for it ATM
Right, should have added that 😄
Advice sought please: Is there a favorite approach or library for animations, for re-frame/reagent? Should one use css animations when possible?
@limist CSS animations when possible, yeah. Didn’t find anything nice for when it gets more complex yet.
@limist there is some stuff in goog.fx
but most of it doesn’t add much over CSS animations
@martinklepsch OK thanks for the advice! Will let the browser do the work...
@limist what kind of animation are you looking for out of curiosity?
@martinklepsch Transitioning new elements (boxes etc) smoothly into the viewport, so they get the user's attention but not in a jarring way. A fade-in, fade-out would also work
That should be possible with ReactCSSTransitionGroup
@martinklepsch Thanks; is this a good example? https://github.com/reagent-project/reagent-cookbook/tree/master/recipes/ReactCSSTransitionGroup
Yeah, I guess it’s reasonable
@limist for enter/leave/move animations we have now switched across to react-flip-move
http://www.upgradingdave.com/blog/posts/2016-12-17-permutation.html
Which is very easy to use and it is better than ReactCSSTransitionGroup
IMO
Oh is that a generic thing? I thought it’s for flipping elements as in the blog post lol
It does enter / leave / move annimations (hard to do with CSS annimations)
for the elements of a list
But, of course, that means you can then get it to handle fade-in and out for panels etc, if you make the panels appear to be elements of a one element list
BTW, the FLIP technique is currently state of the art for animations. Such a neat idea and so perfect for React:
https://medium.com/developers-writing/animating-the-unanimatable-1346a5aab3cd#.fwpc6wjln
If you have the time, this YouTube video explains in detail (from memory this is how I learned about it) https://www.youtube.com/watch?v=RCFQu0hK6bU
@mikethompson Thanks for the advice and links!
is there any way to access the value of a subscription from inside an event handler without having the subscription passed in via dispatch?
@mattly short answer is that you shouldn't Can I ask: do you want to be using the subscription because of the computation it delivers? Or just access?
@mikethompson because of the computation it delivers
Philosophically: subscriptions are designed to deliver "a stream" of new values over time. Within an event handler, we only need a one off value. Operationally: you'll end up with a memory leak.
Sounds like you are suppling the value in the event now?
So you are dispatching
the value @chosen-segment
with the event ?
Question: does the subscription handler look like this
(reg-sub
:chosen-segment
some-fn)
OR does it have a signal fn
Hmm. Okay. This is probably something re-frame should do better