This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-25
Channels
- # announcements (1)
- # babashka (3)
- # beginners (48)
- # calva (1)
- # clj-kondo (1)
- # cljs-dev (6)
- # clojure (29)
- # clojure-europe (15)
- # clojure-spec (1)
- # clojure-uk (8)
- # clojurescript (17)
- # conjure (23)
- # css (7)
- # cursive (16)
- # datascript (1)
- # emacs (4)
- # fulcro (32)
- # hoplon (3)
- # keechma (16)
- # leiningen (1)
- # luminus (1)
- # meander (11)
- # off-topic (18)
- # pathom (15)
- # re-frame (12)
- # reagent (12)
- # reitit (5)
- # reveal (5)
- # spacemacs (5)
- # xtdb (18)
hey there, is there an example for keechma/next that shows how to use it with reagent?
@beders not right now, but it shouldn’t be too hard. There are two options: 1. Sync whole state to the reactive atom and then use reagent’s reactions to implement subscriptions and similar features 2. Use keechma’s subscription system and sync subscriptions with reagent Option 1 is not possible atm - there is no way to sync whole state, but option 2 should be very easy to implement. I can create an example tomorrow
We are using the Helix library. Here’s the integration https://github.com/retro/keechma-next-realworld-app/blob/master/src/keechma/next/helix/core.cljs
This repo has all the code that will be extracted and released over next few weeks, it needs to be cleaned up and documented
for Helix, the integration is done through hooks
For us they are a great solution because we get closer integration with React, and we’re handling reactivity on our own now anyway, so Reagent is an overkill. If you want to try it out real quickly with reagent something like this might work:
(defn my-comp []
(reagent/with-let [local-state (reagent/atom nil)
unsubscribe (keechma/subscribe app-instance :controller-name #(reset! local-state %)]
...
(finally
(unsubscribe))))
No problem, please mention me when you have a question, I’ll try to answer ASAP. I’m checking this channel periodically, but this will ensure I see it sooner 🙂