Fork me on GitHub

@poernahi thank you a lot but it's too hard for me right now


Hi, I’m looking for advice on how to integrate a persistent websocket connection with re-frame. This is the first re-frame code that I write, so I (perhaps naively?) created a global “socket” object that connects, registers handlers and so on. Are there better approaches? What about figwheel and code reloading? I do want a defonce somewhere to avoid re-connecting on every code reload, ye?


hello everyone, how do you manage event handlers chaining ? for instance, I want my application to do some xhrs sequentially, one by one and also I want actual event handlers to stay loosely coupled i.e. no things like

{:handler #(rf/dispatch [:next-step])}
. Is there a part of re-frame api that allows these kind of behavior or should I implement it myself ?


I use re-frame-async-flow-fx


you can declare a kind of chain or pattern, so subsequent events dispatch after having 'seen' e.g. a success or failure


I think there's definitely room for improvement though, @mikethompson mentioned CEP the other day; some sort of pattern matching/state machine/automata could be interesting here.


Hey @zallin you could set some db-state from the success/failure handlers of your events and dispatch a general event which decides (call a multimethod) via the db-state what to do. But that maybe doing manually what @danieleneal suggested.


yep agree @abp that's probably the best way to start, async-flow-fx is more an option to be assessed to see if it's appropriate


@abp yes that s what i ve been thinking too


@danieleneal CEP ? what is it ?


this is the library mike mentioned


ok I ll look into that thx


that could well be overkill though 😄


agree 🙃


Guys, Can someone help me about using react-native-camera external module on re-natal app ? Just tell me, how can I run it within it ?


I'm starting to play around with using taoensso/timbre for profiling ... is there a good place to wrap the outer (profile {} ...) call to catch component activity or am I thinking about this all wrong? My goal is to get timings on some (possibly?) expensive render and component-did-mount work (that last because I'm using D3).


or am I better off with knowing how to better make use of the Chrome devtools?


@rgm I'm not really answering your question about profiling, sorry, but be sure to read (links at the bottom on D3):


re-frame-trace may be useful for timings, maybe. Still developing


But no help for component-did-mount timings


Yeah, I saw that re-frame-trace caught the render but that's dwarfed by D3's work here.


it's nbd to (profile {} (p ::my-tag (do-the-d3-work ...) at its callsite in component-did-mount and just get that timing, but I was just wondering if there's a good strategic place to do that much further out so I can just leave the timbre probes in place and toggle them on/off with one (profile {} ... ).


the advantage there I guess would be that I could get a summary of multiple renders and get the stddev, etc.


(assuming the same component appears multiple times with different props, say).