This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-21
Channels
- # beginners (82)
- # bitcoin (1)
- # boot (38)
- # cider (6)
- # cljs-dev (13)
- # cljsrn (5)
- # clojure (320)
- # clojure-italy (22)
- # clojure-losangeles (6)
- # clojure-russia (55)
- # clojure-spec (25)
- # clojure-uk (48)
- # clojurescript (64)
- # component (16)
- # core-async (6)
- # cursive (54)
- # data-science (2)
- # datascript (2)
- # datomic (8)
- # docker (1)
- # ethereum (1)
- # fulcro (1)
- # garden (1)
- # graphql (16)
- # heroku (6)
- # hoplon (12)
- # jobs (4)
- # juxt (1)
- # leiningen (9)
- # off-topic (39)
- # om (13)
- # om-next (2)
- # onyx (9)
- # pedestal (2)
- # portkey (12)
- # re-frame (25)
- # reagent (6)
- # ring-swagger (4)
- # schema (1)
- # shadow-cljs (10)
- # spacemacs (11)
- # testing (19)
- # uncomplicate (1)
- # unrepl (6)
- # vim (21)
- # yada (3)
What's the current deal with inadvertently returning false from event handlers? Does re-frame handle that for me?
@mbertheau In what context would you accidentally return false
? In my experience accidentally returning nil
is more common. When using reg-event-fx
returning nil simply means 'no effects' and works fine.
:on-click
itself isn't really re-frame
territory. If you dispatch
in your on-click
, that's where the re-frame machinery kicks in.
@mbertheau usually the only thing you will do in on-click
is call a reframe dispatch
and reframe dispatches return nil, so you don't have to worry
@mikethompson @danielcompton @daiyi I updated the PR with a link to a build of docs on my local gh-pages, it gives you an idea about how the docs would be https://github.com/Day8/re-frame/pull/414#issuecomment-331123497
I’m trying to figure out a way to css animate element of the list before it gets removed by an event handler and nothing comes to my mind except dispatching an event [:item/hide id]
that will change its class and then dispatching another [:item/delete id]
, say 300ms later by using js/setTimeout
.
This feels too inelegant. Is there another way?
I can’t help with the overall elegance of the problem but instead of using js/setTimeout
directly just use the :dispatch-later
effect
Whoa. @sandbags. That’s… awesome… despite the fact that I totally do not even comprehend any of it… Wow…
Haha. My first reaction was, “Wow, cool!” My second reaction was, “What does that do?“. My third reaction was, “No wonder my attempt didn’t work — doesn’t look anything like that.” 🙂
Where do I go learn what :<-
is?
@genekim Best place is in the todomvc example source code docs (weird … I know) https://github.com/Day8/re-frame/blob/master/examples/todomvc/src/todomvc/subs.cljs#L30
Theres a good amount in the docstring for reg-sub
too https://github.com/Day8/re-frame/blob/master/src/re_frame/subs.cljc#L176-L261
@nooga you can use ReactCSSTransitionGroup
https://github.com/reagent-project/reagent-cookbook/tree/master/recipes/ReactCSSTransitionGroup
which, I think, does sort of the same thing, only based on extra lifecyle hooks of react elements
(I’ve used it with some success)
@nooga my usage is here. Pardon the horrendous code and the usage of create-class
, that is because of a different concern which could probably be handled more nicely. But the transitionGroup does work 🙂
@nooga in https://github.com/Day8/re-frame/blob/master/docs/External-Resources.md look at link for animation