This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-16
Channels
- # announcements (7)
- # aws (9)
- # babashka (31)
- # beginners (28)
- # calva (14)
- # clj-kondo (29)
- # cljs-dev (23)
- # cljsrn (16)
- # clojure (21)
- # clojure-france (1)
- # clojure-nl (2)
- # clojure-spec (20)
- # clojure-sweden (4)
- # clojure-uk (6)
- # clojurescript (62)
- # community-development (5)
- # conjure (81)
- # cursive (14)
- # datomic (5)
- # defnpodcast (2)
- # docker (1)
- # figwheel-main (11)
- # fulcro (17)
- # graalvm (5)
- # jobs-discuss (5)
- # kaocha (1)
- # off-topic (54)
- # pathom (1)
- # pedestal (1)
- # quil (1)
- # re-frame (34)
- # shadow-cljs (34)
- # tools-deps (39)
- # uncomplicate (2)
I’ve tried a couple of times to understand how to use clojurescript and re-frame. Just when I think I get it I run into things I can’t figure out. I have an app that I’m trying to write (in order to learn) and I can’t seem to get toggle to work. https://github.com/Holmes89/clj-read-list. What am I missing? after clicking the button the icon won’t react. I get the put update.
@holmes89 you are very unlikely to get a response if you just throw an entire repo at us, with vague talk about some toggle not working. Please create a nice minimal case which doesn't work. Give us a bit of detail. Also, keep an eye out in the javascript console for warning and exceptions, etc. Perhaps review what is happening via re-frame-10x
yeah. i actually cloned this but i can't get it to run because its getting a carmine connection error. i need redis locally to run this so i can't help you. sorry
https://github.com/Holmes89/clj-read-list/blob/d8318c4030a305c8f08cd28b02d86aef8511e4a3/src/cljs/reading_list/views.cljs#L41 it looks like the read-book call both fires a toggle-read event and actually toggles the read property of the book. is it possible that it’s being flipped twice?
The new re-frame website is available here in a beta state. https://day8.github.io/re-frame-wip/
Very nice, I like it!
I got a 404 on releases page but it has been fixed now ⚡
Very nice result 👍
My only suggestion would be to increase a bit the line-height and/or font-size for the contents in .admonition.note
The writing itself is top-notch (seems to be based on the old README.md), but I think hiding the code away 6 pages in is detrimental to the goal of making Re-frame more accessible to newcomers. Please consider putting the code up front. https://github.com/day8/re-frame/issues/582#issuecomment-629639596
Very fine work! Who is the author of the prose? I quite enjoyed the writing style... :-)
Any comments in this issue please: https://github.com/day8/re-frame/issues/582
I want to use AWS Amplify in my react app.
I’d like to check if the user is signed in and redirect them to their dashboard if they are.
The library call currentAuthenticatedUser
returns a promise so I am not quite sure how to hook that up to my routing.
Ideally I don’t want the user to see the homepage and then be redirected after a delay.
Could anyone give me some tips on how to do that properly?
I used promesa to handle the promise. When the promise arrived I updated app-db with whatever I wanted, which triggered the flow to the flow further.
So let’s say you want to redirect the user from home
-> dashboard
if they are logged in.
The flow would be
* user lands on home -> kick off promise
* user is on home <- promise returns after x seconds
* redirect user to dashboard
Wouldn’t that be annoying for the user?
Sorry for the basic questions I haven’t implemented auth flows on website before 😕
Sorry, I my description was a bit terse.
I my case the user lands on login screen. She enters username/password and after hitting enter I do validation after which (assumming it was successful) two things happen:
1. Event handler changes the screen state to :logging-in
(I use FSMs as described http://blog.cognitect.com/blog/2017/5/22/restate-your-ui-using-state-machines-to-simplify-user-interface-development and http://blog.cognitect.com/blog/2017/8/14/restate-your-ui-creating-a-user-interface-with-re-frame-and-state-machines ). This activates a sub that changes Login
button into a spinner.
2. Event handler returns
:login {:username username
:password password
:on-success :login-success
:on-error :login-error}
Which is handled by reg-fx
by calling AWS amplify with given data. When the promise eventually resolves it dispatches :on-success
event. Event handler for the event advances FSM state further and dispatches a global event (e.g. ::global-events/user-logged-in
that is handled by a top-level handler that advances the screen wherever you want.Thanks, those posts also look interesting
If you’ve ever looked at using kee-frame, then the new FSM (and other functions) work really well. I do something similar for login using urls and kee-frame FSM.
The resources tabs in the new website is behaving oddly.
@neo2551 corrected now (via a PR), many thanks.
My pleasure. I love the library it is really great to work with.
That's generous of you to say, thank you.
Is it possible to have a collection of all registered events?
In re-frame?
There's no API for it
But you can look into the private data within re-frame if you just want a quick hack
(keys (:event @re-frame.registrar/kind->id->handler))