This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-09
Channels
- # beginners (205)
- # boot (6)
- # cider (22)
- # cljs-dev (41)
- # cljsrn (4)
- # clojure (97)
- # clojure-dev (61)
- # clojure-greece (40)
- # clojure-italy (8)
- # clojure-russia (16)
- # clojure-spec (18)
- # clojure-uk (34)
- # clojurescript (14)
- # community-development (1)
- # cursive (45)
- # datomic (39)
- # fulcro (66)
- # jobs (2)
- # lein-figwheel (1)
- # lumo (9)
- # off-topic (8)
- # parinfer (98)
- # portkey (8)
- # re-frame (81)
- # reagent (54)
- # remote-jobs (17)
- # ring (2)
- # shadow-cljs (217)
- # spacemacs (32)
- # sql (24)
- # test-check (6)
- # unrepl (73)
- # yada (12)
re-framers fellow re-framians :-)
@joelsanchez your words have been re-framed. 😉
@joelsanchez looks clear enough. Didn’t know you could chrome like that from clojure, might want to use it for running tests
Hey, struggling to find the terms for this, but what's the practice for "derived subscriptions?"
think it’s best to create a seperate subscription for it, because you only want to re-render when even numbers change
but feels easier to write (subscribe [:filter even? [:filter bigger-than-10? [:numbers]]])
than to write
Hello re-framians, re-frame-trace 0.1.19 is out: https://github.com/Day8/re-frame-trace/releases/tag/0.1.19. There’s a big change to how subscriptions are processed which should be more accurate. Give it a spin and let us know if there are any issues. We’re finishing up work on re-frame-trace very shortly, so nows the time to get your feedback in.
@danielcompton thanks! Loaded in my project, everything seems to be working fine.
@danielcompton: you got any thoughts on derived subscriptions ⏫?
@shen a first principle for re-frame is to store everything as pure data as much as possible instead of functions. So I probably wouldn’t want to be passing functions to a subscription
If you have a bounded set of possible filters, I could imagine passing data parameters to a subscription which configures which filter transducers are run.
Can you give a bit more context to the problem you’re trying to solve?
now, if i wan red squares, I'm thinking I can either have [:gizmo-by-shape-and-colour :square :red]
so I only need to write 4 subs, and at run time, these data only subs are constructed, with some code like
We have a similar kind of pattern in our code base, I’ll need to check and see what we did there. I think I’m at least one case we built up a materialised View in event handlers responding to filters changing (though that was very complicated from memory)
@shen the current colour (`:red`) will be stored in app-db
somewhere, yes?
I can't see these filter
terms coming our of thin air
They'll be arising because of user actions ... so they'll be in app-db
?
Anyway, ignoring that line of questioning ... back to your line of reasoning (that the view supplies the filter terms) wouldn't you just do it as something like this ...
(subscribe [:gizmos {:shape :square :color :red}])
@mikethompson think I see what you are getting at. that if there's a shape dropdown, and color dropdown, then can hook it up that way?
By "composability" are you indicating that you might want "many"
i.e. many components each asking for their own list of gizmos, using their own (local) set of filters?
So "many" of these components can be on-screen at once ... is that the challenge?
Not really
I'm just trying to understand the challenge
When you say 2^3 possibly types of components
then you mean there can be one component on the screen which can be in any one of 8 configurations?
And by "configurations" we mean "configurations of filters"
I'm finding it hard to see any variation of this that involves more than one subscription (although if you want what I call the "many" arrangement, you might need multiple "instances" of this one subscription)
no problem
@shen, this might not be helpful to you, but we put together https://github.com/riverford/compound for the case when you have things (e.g. gizmos) that you might want to filter or index by multiple things (e.g. by colour or shape). The materialized indexes are built as you put data into the db.
thanks @danieleneal
it's for interop I think
totally impossible to search for :s
but something akin to reagent's adapt-react-class
@faxa @danieleneal It's described here: https://reagent-project.github.io/news/news060-alpha.html
nice!
When I have several events which change parameters of a query, and every time something changes I want to trigger several events. What would be the most idiomatic way to do this with re-frame. I could subscribe to a map containing all the parameters, and then trigger an event handler?
@gklijs generally you don’t want to tie the output of a sub into running an event handler
it breaks the cycle of data
You could make an effect which handles the rerunning of the events?