This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-26
Channels
- # admin-announcements (1)
- # beginners (12)
- # cider (2)
- # cljs-dev (6)
- # cljsrn (4)
- # clojure (123)
- # clojure-austin (10)
- # clojure-brasil (1)
- # clojure-canada (21)
- # clojure-conj (5)
- # clojure-dev (8)
- # clojure-gamedev (42)
- # clojure-russia (121)
- # clojure-sanfrancisco (2)
- # clojure-spec (25)
- # clojure-uk (36)
- # clojurescript (195)
- # clojutre (3)
- # cursive (43)
- # datomic (6)
- # defnpodcast (2)
- # dirac (14)
- # emacs (2)
- # ethereum (2)
- # events (2)
- # funcool (6)
- # hoplon (76)
- # jobs (1)
- # kekkonen (9)
- # lein-figwheel (1)
- # leiningen (4)
- # mount (6)
- # off-topic (5)
- # om (2)
- # onyx (91)
- # pedestal (2)
- # protorepl (14)
- # re-frame (22)
- # reagent (20)
- # rethinkdb (1)
- # ring (2)
- # schema (3)
- # sfcljs (3)
- # spacemacs (15)
- # specter (12)
- # testing (1)
- # yada (63)
I bet this has been discussed before, pardon my ignorance, I did not find anything in the wiki nor the docs.
My question is regarding 0.8.0
. The new subscription model is beautiful but I have one use case I’m not sure if it can accomodate:
edit: will add snippet instead
(reg-sub
:user/full
(fn [[_ user-id] _]
[(subscribe [:users user-id]
(subscribe [:user-settings user-id])])
(fn [[users user-settings] [_ user-id]]
(merge
users
user-settings)))
Docs are lacking, but have a careful look through here: https://github.com/Day8/re-frame/blob/develop/examples/todomvc/src/todomvc/subs.cljs
@mikethompson: Great! And outstanding work on re-frame! A pleasure to work with!
Good to hear 🙂
Another question: could I somehow use subscriptions as input, say that I had to get user-id from (subscribe [:user-id])
instead of from the subscription call?
Ok! The wiki is not updated to 0.8.0
on that part, but maybe that is still how it should be done?
well, everything from 0.7.0 is still in 0.8.0, just register-sub has been renamed to reg-sub-raw
@yogthos: I added memory-hole to the re-frame wiki external resources page https://github.com/Day8/re-frame/wiki/External-Resources
Kind of a noob question: I’m using Bootstrap 4 with reagent/re-frame, and I want to use a button group as a dropdown menu. If I just naively plug in the code from the Bootstrap docs, it doesn’t drop down, which I assume is because Bootstrap js code isn’t expecting to talk to React. So I’m doing the re-frame approach of firing events, setting a flag in the app-db, and having the menu contents show or hide based on the flag. That all works, but it seems labor intensive. Is there a better way?
@manutter51 I suppose it is subjective, but you don't have to put everything into app-db. you could still leverage a simple ratom to handle that component state, assuming it's not needed anywhere else in the app
@manutter51: Have you taken a look at how re-com does things? Might give you some ideas - https://github.com/Day8/re-com/blob/master/src/re_com/dropdown.cljs
Ah, re-com has a dropdown? I’ll have to check that out, I looked at the library once upon a time but it’s been a while. Thanks!
It’s after 5:00 on a Friday after a long week, and an hour ago I decided to move a db column out of one table and into another for better data normalization. Now it’s a little less than an hour later, and I’ve moved the column, updated the migrations, updated all affected SQL queries, updated all the AJAX endpoints, updated all the re-frame event handlers and the UI components, and tested it, and everything works.
Did I mention I FREAKIN LOVE working in Clojure/CLJS/reagent/reframe?
@manutter51: Best feeling ever 🙂
The only downside is this nagging feeling I’m gonna get caught — it’s so much fun, it’s like this has got to be against the rules somehow