(d/q '[:find [(pull ?e ?pattern) ...]
:in $ ?sf ?pattern includes?
:where
[?e :person/firstname ?f]
[(includes? ?f ?sf)]
[?e :person/id ?i]]
db search-firstname pattern includes?)
includes? is a function. This works in development, but returns []in production compiled with shadow-cljs in a webworker. What do I have to do to the function so it works in advanced compilation?This works:
(d/q `[:find [(~'pull ~'?e ~'?pattern) ...]
:in ~'$ ~'?sf ~'?pattern
:where
[~'?e :person/firstname ~'?f]
[(~includes? ~'?f ~'?sf)]
[~'?e :person/id ~'?i]]
db search-firstname pattern)
:compiler-options {:externs ["datascript/externs.js"]} did it.