Hi, I'm new to fulcro and I have trouble understanding how mutations work. Is there some real-world or working example of a fulcro app with inputs and all that I could look at?
@holyjak What I struggle with in particular is how to put, say, an entire list of persons into the DB in your tutorial setup. It seems like merge-component is the solution here, but I can't do that in a mutation since it would create circular dependencies (the function requires the app and the component, the latter requires the mutation and now I'm in trouble, it seems). In my specific case, I upload a CSV into the browser. I turn it into a list of maps and now I want to somehow put it into my database. I could use swap!
however, that also means that I have to manually do all the stuff that, I thought, fulcro takes care of, or am I completely on the wrong path?
Reading your tutorial, it seems load!
might be the right tool...
Load is the tool if the data is provided by a remote api. For the circular dependency there is a solution too, in the components namespace there are maps, functions to go from :my.ns/MyComponent to the component class. See https://book.fulcrologic.com/#CircularRefs
Ooooh, the action has the component and application on the :env
map!
@hk9861 https://chrisodonnell.dev/posts/giftlist/deployment/?
Also in a mutation don't use merge-component! but merge-component
Also new to Fulcro. Started spending some time on the docs a couple of weeks ago. Besides the official docs, Tony’s grokking fulcro series has been extremely helpful for me: https://youtube.com/playlist?list=PLVi9lDx-4C_TBRiHfjnjXaK2J3BIUDPnf
I have a template that gives you a working app here:
https://github.com/dvingo/dv.fulcro-template
it uses clj -X:new
to generate a new project for you.
If for no other reason, you can use it to see a working example - it has a sample data model + ui that persists to a crux db.
If you do try it I'd love to hear any feedback you have (good or bad!).
Thanks for these suggestions, I’ll try them out!
@kamilwaheed0 @gerome.bochmann Actually there is a Tutorial Playlist für Fulcro 3. https://www.youtube.com/playlist?list=PLVi9lDx-4C_T7jkihlQflyqGqU4xVtsfi The "Grokking Fulcro" Series is more about the internal workings of Fulcro The 3rd video is about mutations: https://www.youtube.com/watch?v=KJsFLmkdRig You can find the files from the videos here: https://github.com/fulcrologic/video-series
Anything in particular you struggle with? I'm always looking for things to improve in https://fulcro-community.github.io/guides/tutorial-minimalist-fulcro/...