Ok, I'm trying to figure out how to use to get useful error messages, but I cannot figure out what how I'm supposed to do it if I'm also using contexts
Here's my renderer and my main fn, which is where I think the documentation says I'm supposed to make the change:
(def renderer
(fx/create-renderer
:middleware (comp
fx/wrap-context-desc
(fx/wrap-map-desc (fn [_] {:fx/type views/root})))
:error-handler (bound-fn [^Throwable ex]
(.printStackTrace ^Throwable ex *err*))
:opts {:fx.opt/map-event-handler event-handler
:fx.opt/type->lifecycle #(or (fx/keyword->lifecycle %)
(fx/fn->lifecycle-with-context %))
}))
(defn -main
[]
(Platform/setImplicitExit true)
(fx/mount-renderer *state renderer))
Where do I add the relevant :fx.opt/type->lifecycle ? It's an or, do I just drop it in there?You use it to wrap your own lifecycle
There is cljfx.dev/wrap-type->lifecycle
Use that to wrap your lifecycle
So it looks like this: ... :fx.opt/type->lifecycle (cljfx.dev/wrap-type->lifecycle #(or ...)) ...
Ok, so when I try that I get the following error. And removing that wrap removes the error:
clojure.lang.ExceptionInfo: Cannot invoke "java.util.concurrent.Future.get()" because "fut" is nullI'm currently not using the devMode? flag, I'm just hard-coding it in first to test it. The relevant opt looks like this:
:opts {:fx.opt/map-event-handler event-handler
:fx.opt/type->lifecycle (cljfx.dev/wrap-type->lifecycle
#(or (fx/keyword->lifecycle %)
(fx/fn->lifecycle-with-context %)))}))Hmm
What's the stack trace?