For quite some time I was doing option 1. However, I kept facing this issue again and again and this week I had enough :) It's kinda waste of time to first build your subscription chain and then at some point understand that you need this value in an event handler which means that you need to refactor all the subscriptions and extract the computation functions. And of course, things get more complicated with longer subscription chains. So I finally decided to install re-frame-utils and start using the inject-sub. I've been very happy with it. I'd maybe recommend to skip the option 1 and move straight to 2, you'll eventully want to do that anyway :)
thanks @rap1ds, I’ve done the 1st one already, this is a small page/component so maybe this is not going top happen any time soon, but next time I know where to look
I have a n00b question. I cannot get the debug interceptor to work. I have read the docs thoroughly but can't get it to output to my console. goog.DEBUG
is true as tested from my REPL and I tested js/console.debug
and it printed to my console.
Have you overridden re-frame logging in any way with set-loggers!
?
No.
Does (re-frame.core/console :log "hello")
work?
No.
What does (re-frame.loggers/get-loggers)
output?
{:log #object[bound],
:warn #object[bound n],
:error #object[bound n],
:debug #object[bound],
:group #object[bound],
:groupEnd #object[bound]}
Not really clear, OK.
Does (js/console.log "hello")
work?
Yes.
Does (re-frame.core/console :log "hello")
work after you run (re-frame.loggers/set-loggers! {:log (js/console.log.bind js/console)})
?
Yes.
Well, something in your code or in one of the libraries must be calling re-frame.loggers/set-loggers!
and overriding the default loggers.
Ok. I will reset them in my init...thanks for your help!
1👍One thing - you should call re-frame.core/set-loggers!
instead of re-frame.loggers/set-loggers!
. The latter is a private API - I was mentioning only because I was looking at that ns.
If this works the same way loggers like timbre do, you also need to enable verbose logging in chrome console. The dropdown is "Default levels" at the top