Fork me on GitHub
#fulcro
<
2019-05-26
>
tony.kay15:05:02

Community help wanted: I know the docs say how to do this, but I’m doing so many other things I don’t feel like researching it…how do I make a spec that will report the right thing like this:

(s/dev ::thing (atom-of ::other-spec))

tony.kay15:05:50

where the explain output works right (e.g. goes into what is wrong with other-spec

tony.kay15:05:02

a predicate won’t do that…I think it might need to be a macro?

tony.kay17:05:42

well, but I have an “app” data structure that has things in atoms, and I want to see errors on it when Ipass it

tony.kay17:05:50

so, what do I do, use Schema instead???

tony.kay17:05:21

I’ll read it, thx

tony.kay17:05:40

I guess that makes sense. So, drop the nested checks when passing ::app around, and instead put checks wherever the data in the atoms are used…that’ll work. Gotta love learning new ways of dealing with “alternatives to type checking” 🙂

👍 4
souenzzo12:05:20

you can make something like this https://github.com/tonsky/datascript/blob/master/src/datascript/core.cljc#L401 Where db? can be a (s/valid? ::-app @app)

tony.kay15:05:14

possibly, but I think the right thing to do (now) is what Alex is saying in that reference. The deep checking I was doing was overkill and didn’t really lead to anything useful when Ithink about it.

Chris O’Donnell23:05:58

Has anyone had luck getting React hooks to work with fulcro? I've tried putting them in a function component's let binding as I see in https://github.com/fulcrologic/fulcro/blob/feature/react-play/src/main/play/main.cljs, but every time I look at the compiled js the hook gets bound as a var instead of a const. Is there just a trick to it I'm missing?