This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-19
Channels
- # 100-days-of-code (12)
- # beginners (116)
- # calva (2)
- # cider (16)
- # cljdoc (5)
- # cljs-dev (26)
- # clojure (161)
- # clojure-italy (7)
- # clojure-nl (9)
- # clojure-spec (49)
- # clojure-uk (112)
- # clojurescript (50)
- # clojutre (4)
- # core-async (2)
- # cursive (4)
- # datomic (192)
- # emacs (10)
- # events (4)
- # figwheel-main (147)
- # fulcro (94)
- # graphql (5)
- # instaparse (1)
- # jobs-rus (1)
- # keechma (10)
- # leiningen (223)
- # luminus (3)
- # mount (23)
- # nrepl (8)
- # off-topic (44)
- # onyx (10)
- # pedestal (5)
- # re-frame (19)
- # reitit (8)
- # shadow-cljs (62)
- # uncomplicate (3)
@b2berry take a look at step 3 https://stripe.com/docs/stripe-js/elements/quickstart. The way we’ve used stripe is creating an element in stripe, calling a function on that element to mount it to a div. And then calling the addEventListener
function on that element and giving it a callback. All of this life cycle is managed using a form 3 component
That might help.
Thanks caleb. I actually just an hour ago got the stripe react components working which might do the trick.
Reflecting on this defining the card element might be best done in the lifecycle of the component
I might double back and consider your approach using the Stripe Checkout.js solution, which ultimately I wanted to use moreso than Stripe.js and custom route.
Okay good luck! 🙂
I don’t think so, assuming the lifecycle method :component-will-unmount (or another similar) is set up correctly.
Are you running into issues with that are just wondering?
No, I’d need to take this approach for a test drive. I just get a little uneasy around coordinating listeners. Probably just residual PTSD from many years back in the early jQuery days.
mounting and unmounting happens when a component is removed from the view. So as long as you completely remove it from the view the unmount lifecycle should call whatever you give. I’m quite confident in that. In the past we’ve had modals that have had to stay in the view for animations that have caused complications around this though so take that into consideration. As far as the reliability of the create & remove event listeners on the stripe component goes I’m not to sure. I’d assumed it worked correctly. You could test this by removing the event listener manually while the component is in the view and ensure that your events stop firing
When working locally is there a way to have http data I fetch hang around on hot-reload?
@dfcarpenter Where are you putting this data? If it is in app-db
it will hang about
Is there a way to check if kwd
has already been previously registered using (reg-event-fx kwd ...)
?
Have a list of route handler keywords, and want to register a default handler for any route that hasn't yet been registered (if that makes sense).
@samedhi you can use the value of this atom: https://github.com/Day8/re-frame/blob/master/src/re_frame/registrar.cljc#L15
@samedhi there is no officially sanctioned way. As @codonnell indicates, you'd have to reach into the implementation.
if you wanted to access the handler for id
then:
(get-in re-frame.registrar.kind->id->handler [:event id] :not-there))