Iām having some trouble understanding how to write async coeffect-handlers (e.g. loading some data from a server)? Am I misunderstanding the intended purpose?
There can be no async coeffects. But there can be async effects that load the data and put it into app-db.
OK, thanks:)
Is it normal that when adding or changing effect handlers, everything stops working with hot code reloading until I refresh the page?
Use defonce
when defining history
instead of def
.
Amazing! Thanks. Should I submit an issue or a pull repo (not sure I know how) for the template?
When your code gets hot-reloaded, the routes namespace is re-evaluated, so with (def history ...)
you create a new history object each time it's re-evaluated. But you don't call start!
then, so pushy
ends up using a new history that hasn't been used in start!
.
> Should I submit an issue or a pull repo (not sure I know how) for the template? Sure! I think it makes sense. First an issue and then a PR for that issue.
should be a trivial change if I know where to find the code in the template thing š thanks again
No.
Now I'm worried š I wonder how to debug this
Your problem definition is very vague so I can't really give any hints.
Hmm, actually it's just the navigation bar that stops working... rest of the app seems to function fine
I'm pretty much doing what the re-frame template does for navigating when you make the template with the option +routes
The event still shows up in the debugger view (can't remember if this was re-frisk or the other one) but nothing seems to happen... the db doesn't get updated with the new panel
If you spend a significant amount of time on it without any progress, create a repo with a minimal reproducible example and with the exact steps I need to do to reproduce the issue, and I'll take a look.
hmm, alright. I'll see if it happens with a fresh from template app. Because pretty sure I'm dispatching the navigate event the same way as in the examples
@p-himik here is an explanation of the steps and a repo https://github.com/Sose/brokennav/blob/main/explanation.md
I wonder if it's my system or the template or what
I tested with Chromium and Firefox and it happens in both for me