Fork me on GitHub
#re-frame
<
2021-03-08
>
mathias_dw11:03:07

I just had a weird bug, and even though it's fixed, I don't understand what's going on: The bug was that I had written an event handler with reg-event-fx, and only returned a :dispatch key, no :db. The thing is: it worked fine, so I guess I tried it and found that it's not necessary to type the extra :db a few times. But now I registered a global event handler, and suddenly things were going wrong, since the effects db was nil. I suppose there's a mechanism that copies the db if the effects db isnt there at the end of the chain? Is that something well known?

p-himik11:03:21

It is well known: https://github.com/day8/re-frame/blob/fd12bd3a2c92aae62508071c7b70f95e8eaa58fb/docs/Effects.md#db-not-always-needed Why it wasn't working with a global interceptor depends on what exactly was going on in that interceptor.

mathias_dw11:03:10

Ah yeah, thanks. As always, reading the docs better would have solved it 🙂

😉 3
afleck15:03:22

I’m running into an Eval timed out! error message when trying to sub some but not all of my subscriptions. Seems to be the ones with a lot of data, also seems to be associated with the error (which appears in nrepl buffer) WARN - Max payload length 4m, get: 4322857 , which i think is a websocket-related warning? Kind of stumped by this one. I’ve tried the easy stuff like lein clean and restart repl, but no luck. This started happening recently too…

p-himik15:03:22

Where exactly do you get that error? In a browser JS console?

afleck15:03:26

no, when I try to run the same subscription in the connected figwheel repl. Sorry, I should have mentioned that. The subs appear to work fine in the actual application, that is the functionality that relies on the subs works.

afleck16:03:01

After doing a quick profile in chrome devtools, it indeed seems like there is an extremely large amount of pprint thrash

afleck16:03:18

and related functions, write-out etc

afleck16:03:35

ahah, yes, if I wrap the sub call in e.g. type, works fine. So definitely seems to be a printing issue

p-himik16:03:29

Yep, has nothing to do with re-frame. :)

afleck16:03:13

thanks for letting me sound it out here, will head elsewhere