Fork me on GitHub
#re-frame
<
2017-11-30
>
sb16:11:39

I used before this DynamoDB and MongoDB, what is the best way to use re-frame with Datomic? (“posh?” “datasys?” “datomic-cljs?” ..?)

sb16:11:34

Eg. use via sente at serverside? What is your experience, which is the best if you have lot of queries?

p-himik16:11:52

@sb If you start thinking about DataScript, first measure performance with your typical queries. In my case, it was at least an order of magnitude slower than a simple map, so I decided not to use it. Just my 5c.

sb16:11:30

Thanks!! useful 5c! 👍

xiongtx17:11:55

When doing component-level testing on a component that loads data via some event, I usually take the approach of: - Using a fixture that saves, then restores the app db - Registering the event again, but w/ a mock - Mounting the component and testing This works fine, though it emits a warning, e.g.: re-frame: overwriting :event handler for: :foo/bar I’m curious as to what other approaches people take. For example, another approach I’ve considered is to create a version of the component that takes the event as an argument so the mock can be passed in during the test; the “real” component can then just be a thin wrapper around this version that takes the desired event handler as the default arg. This actually seems like a more “functional” approach.

Keith21:11:01

Hello, I’m very new to re-frame and I’m just curious if the way I’m using it makes sense. My web page makes a request to the backend to retrieve possible commands that can be run which ends up looking like:

{"Name of Section 2" {:commands {"Name of Command1" {:important false :result "pending"}
 								 "Name of Command2" {:important false :result "pending"}}}
 "Name of Section 2" {:commands {etc...}}}
Initially I tried to map through the sections and commands and dispatch an http-fx event. The problem I ran into was that I was doing this dispatching in the view, which for some reason caused subscriptions in the view to not receive updated data after the event ran. The only way I could find to fix this was to move the dispatching of multiple http-fx events out of the view and into events as {:dispatch-n} Can someone explain to me why I couldn’t simply dispatch multiple events from the view?

Keith21:11:09

In hindsight, I wonder if the issue has to do with the fact that I had a base subscription which created various DOM elements and those DOM elements had their own subscriptions