You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In https://github.com/Day8/re-frame/blob/master/src/re_frame/subs.cljc#L188, the work of traversing & dereferencing is being done twice. It looks like the purpose of the inner cond form is to print a warning if an unexpected argument is passed in. Maybe we could move this check into the :else clause of map-signals, and allow for elision in prod? along the lines of:
(defnmap-signals"Runs f over signals. Signals may take several forms, this function handles all of them."
[f signals]
(cond
(sequential? signals) (map f signals)
(map? signals) (map-vals f signals)
(deref? signals) (f signals)
:else (do (when debug-enabled?
(console:error"re-frame: in the reg-sub for" query-id ", the input-signals function returns:" signals))
'())))
The text was updated successfully, but these errors were encountered:
Thanks for catching this, it does look like a bug.
In 64f858c I extracted part of deref-input-signals into map-signals so that I could reuse the same mapping logic when tracing the signals.
There was a bug in that code though, and I fixed it in 1e82e55. However, that also introduced unnecessary derefs that weren't actually used, except for the side-effects of logging the error. The second set of derefs can be removed, we just need to find the right place and conditions for the logging statement to run.
In https://github.com/Day8/re-frame/blob/master/src/re_frame/subs.cljc#L188, the work of traversing & dereferencing is being done twice. It looks like the purpose of the inner
cond
form is to print a warning if an unexpected argument is passed in. Maybe we could move this check into the:else
clause ofmap-signals
, and allow for elision in prod? along the lines of:The text was updated successfully, but these errors were encountered: