This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-27
Channels
- # aleph (3)
- # beginners (89)
- # boot (198)
- # cbus (4)
- # cider (11)
- # clara (2)
- # cljs-dev (27)
- # cljsrn (4)
- # clojure (141)
- # clojure-austin (4)
- # clojure-italy (11)
- # clojure-nl (1)
- # clojure-poland (2)
- # clojure-russia (35)
- # clojure-spec (33)
- # clojure-uk (55)
- # clojurescript (111)
- # core-logic (15)
- # cursive (2)
- # datascript (47)
- # datomic (132)
- # emacs (4)
- # jobs (1)
- # lein-figwheel (13)
- # leiningen (15)
- # lumo (20)
- # off-topic (110)
- # om (8)
- # onyx (20)
- # parinfer (2)
- # protorepl (1)
- # re-frame (36)
- # reagent (5)
- # remote-jobs (1)
- # ring (2)
- # ring-swagger (5)
- # specter (6)
- # uncomplicate (3)
- # unrepl (77)
Hello all, is there any way to set more than one value for reg-event-fx
to {:db (assoc db :dialog true) ... other assoc ...}
?
@fabrao you could use the thread first function:
{:db (-> db (assoc :dialog true)
(assoc :other false)}
@fabrao if using merge
be aware it only works to one level
(merge {:a {:aa 2}} {:a {:bb 1}})
gives {:a {:bb 1}}
and not {:a {:aa 2, :bb 1}}
There's been many a paper cut from that
Hi, I just made my first re-frame app and I would like to receive some feedback of possible, you can find it here: https://github.com/thomas-shares/todo-app2
@fabrao assoc is variadic, just give it multiple pairs of keys and values and they will all be added. No need for multiple calls or merge. https://clojuredocs.org/clojure.core/assoc
@curlyfry @mikethompson Thanks for the corrections! I didn’t know either of those things.
Hi, I would like all my event-db|fx
to run a spec check afterwards, and I wanted that to be the default, so I wouldn’t need to pass the interceptor to every event handler. Is there a “proper way” of doing that? A wrapper fn would do, but I would prefer not to if possible, I don’t want to create an API on top of re-frame.
Maybe what I’m trying to do is not appropriate, so feedback is very welcome 🙂
@pedrorgirardi In the past, I've used a wrapper function when I wanted to apply some base interceptor stack across the board.
thanks @jebberjeb! I’m considering the wrapper fn option, if there is not a “better way”, I might do that then.
@pedrorgirardi cool, I'm also curious to hear if anyone has any input on a more idiomatic solution.
yeah, me too.. and maybe there is 🙂
..and I’m using expound instead of the default s/explain
in cljs.spec.alpha
. expound has pretty good error messages
Does anyone have used https://github.com/nodename/stately or https://github.com/jiangts/re-state in large re-frame apps, any lessons learned or recommendations? thinking of adding it to our app (around 20K LOC), and wanted to get some feedback before doing so.
my fork basically just makes it usable with re-frame 0.9.x, which seemed to be less of a priority in the original stately
repo.
it’s generally useful for complex, stateful components. I used a statechart to untangle a video player I was building. Really nice to have all the logic implicitly encapsulated in the declared states, transitions, and actions
however, for many simple, independent events and subscriptions it’s overkill. Only when events/subs need to be orchestrated in some manner is a statechart really useful in my experience
@jiangts I am very interested in using statecharts for an app I’m building. Is there an example app using re-state?
@U0EP0D9FE I haven’t created an example app yet — I just grafted it into the codebase I’m working on. Not 100% sure if the original stately demos still work with re-state. Would be happy to put together a mini example after work sometime this week
@jiangts our app is 20K LOC and getting a bit out of hand. We basically break handlers and subs into separate controllers which loosely controls different pages (or panels) of the app, but they have dependancies between them, so I thought to have them represented as components in re-state
^^that might prove fruitful. Unfortunately, I’ve only used it for work, so I don’t have an example on github. But as mentioned, would be happy to put one on github sometime this week
components that are written in the conventional way (i.e: not leveraging reagent's reactify-component
or current-component
@yedi http://reagent-project.github.io/news/news060-alpha.html look at heading “Better interop with native React”