This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
I'm new to Fulcro (coming from om.next) and having some trouble writing a custom remote, and I'm hoping somebody can help me or point me in the right direction. I'm following the example from the book (http://book.fulcrologic.com/#_writing_your_own_remote_implementation) about what to pass the result-handler
function (e.g., a map with body
, original-transaction
, and status-code
) with the intention of getting a merge of the value in body
to the root of my database. Specifically, I want to see data returned from my custom remote like this {:audio/duration 100}
end up in my database (such that afterwords I could (get @state :audio/duration)
which would return 100
). However, I can't seem to make that happen, even if I set the original-transaction
value to [:audio/duration]
, which appeared to be documented/possible from my reading of the section of the book about merging (http://book.fulcrologic.com/#_merging_state)... I've looked at the implementations of the mock and HTTP server provided by Fulcro, but couldn't tell what it was that I'm doing wrong. I assume there is something fundamental that I'm missing, but any help or guidance on this is greatly appreciated. thank you!
Out of curiosity, is there a particular reason namespaces went from fulcro.*
to com.fulcrologic.fulcro.*
?
I’m following the general principle that if it is a different thing, it should have a different name. 2 and 3 are not API compatible, they are API-alike. Also, I wanted to split things into more nses to improve incremental compile speed. The standard Java naming convention, which I’ve used, is simply a good idea to prevent collisions in global space…Have you seen a project by Rich that doesn’t use the convention? My earlier versions were “trying to fit in” with the naming I saw commonly in CLJ libs (I come from a Java bg, and always thought the naming conv was good idea). After I got better at Clojure, I realized the common convention was either laziness or aping crappiness from other places. So, rather than inventing new shorter names that were crappy, I went with what I consider to be safer, more well-reasoned names from Java-land, as Rich has. IDEs will auto-complete them, so “typing convenience” isn’t much of an argument not to, but is the only one people ever seem to try.
That's a complete answer, thanks!
Technically you can mount an F2 and F3 app on the same page, but I don’t ever recommend using both that the same time in a project, since it is way too easy to require something from one and use it in the other and end up with a bug that is terribly difficult to figure out.