Fork me on GitHub
#fulcro
<
2019-07-28
>
daniel.spaniel16:07:23

how can i pick up the reader error I am getting from a pessimistic mutation like this

daniel.spaniel16:07:26

(defmutation create-invoice
  [{:keys [invoice]}]
  (ok-action [{:keys [ast ref state]}]
    ; how can i get the error pathom is sending
    ; as =>  "~:com.wsscode.pathom.core/reader-error"
    (swap! state do-stuff invoice))

  (error-action [{:keys [state ref] :as env}]
    ;error action not firing because pathom
    ;swallows exceptions so I am trying to use
    ; ok-action to get the reader-error
    )
  (remote [env] (pm/pessimistic-mutation env)))

daniel.spaniel14:07:27

i know exactly what your talking about here .. ( and i like this solution better) i just can't seem to figure out how to actually make it happen .. not hard, just a detail

daniel.spaniel16:07:08

if i can't get pathom to throw the error so i can catch it in the error-action, i was going to use the ok-action to read the error manually

daniel.spaniel17:07:26

i saw that .. and i get the idea i just don't know how to make this one particular resolver fail fast ( i tried somethjing and it not work )

Ahmed Hassan16:07:43

How can I use React Hooks with Fulcro?

Abhinav Sharma22:07:27

Hi @ahmed1hsn, it's on the Roadmap but so far we haven't been able to make much progress here. I suggest you rely on what Fulcro provides by itself :)

👍 4
hmaurer17:07:39

@ahmed1hsn you can use them with function componeents strsaight way

👍 4
hmaurer17:07:48

you can’t use them in components defined with defsc, however

Adrian Smith19:07:56

I'm thinking about learning more about Fulcro via the book, with Fulcro 3 coming are there any sections I may need to revisit afterwards?

mdhaney01:07:04

If you are just starting to learn Fulcro, I would suggest just starting with Fulcro 3 and use the updated book here: http://book.fulcrologic.com/fulcro3/ IIRC Tony said the first 10-11 chapters have been updated completely for Fulcro 3. The later chapters, well just be aware that they could be out of date, in particular anything referring to the server side, full stack mutations, etc. It’s probably also useful to read through this doc: https://github.com/fulcrologic/fulcro3/blob/develop/PORTING-FROM-2.x.adoc That’s a good overview of what has changed between 2 and 3, so no matter which one you choose to learn first, you’ll at least have an idea of the changes and can keep them in mind as you learn. Although a lot has changed under the hood, Tony has done a good job keeping most of the public API stable (and to be fair, a lot of what did change was cruft inherited from Om-next, which Fulcro was initially based on), so the differences aren’t as drastic as you might think. And of course, you have this channel to help you, too. Besides Tony (who has some how figured out how to squeeze 26 hours into a day, apparently), there are quite a few other knowledgeable people who can answer questions.