Fork me on GitHub
#malli
<
2024-04-29
>
Tommi Martin10:04:19

Summarising the thread for my issue: it has been resolved. I now can return a string or a keyword from the dispatch function correctly. Problem wasn't the syntax of the dispatch function but the schema I had written. I used multi at the top of [::m/default [:multi ... which causes it to get all the remaining fields as a one big clump making correct return very difficult. In my case using [::m/default [:map-of :keyword [:map-of :keyword [:multi {:dispatch custom-db} ... syntax cleaned up the calls to dispatch from "one call that has all fields" to "multiple calls, once for each unresolved submap." and enabled the string/keyword return to work as intended. I should've paid more attention to my schema over worrying about the nitpickings of how dispatch functions. Sorry for the bother.