Fork me on GitHub
#fulcro
<
2023-02-15
>
Jakub Holý (HolyJak)08:02:39

Hi @tony.kay! I wondered, why is the mutation + params passed to df/load! as two separate things? The mutation is data so we could do {:post-mutation (dr/target-ready {:target ident})} instead of {:post-mutation dr/target-ready :post-mutation-params {:target ident}}` ?

tony.kay20:02:08

History and bw compat. Fulcro 2.0 didn’t have mutations that would self-return themselves as data, so you had to use syntax quoting to put things in them [(f {:x ~a})]` which was kinda ugly. So, since post mutations often needed params my early design choice was to let users avoid the quoting by doing it that way and constructing the EQL for them.

👍 2
tony.kay20:02:23

We could add yet another option (`:post-txn` ?) but it’s getting a bit cluttered already 😄

Jakub Holý (HolyJak)07:02:15

Couldn't we extend post-mutation to accept both, either a symbol or the full mutation = list?

tony.kay20:02:21

then what do we do if they give a list AND :post-mutation-params? Merge the params? Ignore them? It gets messy

Jakub Holý (HolyJak)20:02:03

That is true but I would allow them to shoot themselves into the foot by providing params that will be ignored. To me the possibility to use the simpler and more natural :post-mutation (my-mutation {..}) is worth the small risk of some ppl trying to mix the two. But YMMV, of course.

Eric Dvorsak08:02:08

could also do that with a new name for df/load! ?

tony.kay02:02:47

same problem: larger surface API, and I’m not sure I think it’s worth it for such a simple thing you can accomplish with a wrapper of your own. If we had some idea that added something of significance, then I’d be more inclined. As it stands it’s just pretty trivial.

greg18:02:17

Feel free to remove it if you find it inappropriate. Clojure is a niche, but Fulcro is a niche within a niche. I'm looking for a next role and it would be awesome to work with Fulcro. Sorry for posting here. If by any chance you are looking for someone, I'm available even if required to work on-site (UK based, but I might be willing to relocate within Europe or to South America). More about me https://clojurians.slack.com/archives/C05006WDW/p1676486117084959.

tony.kay20:02:04

Hey Greg. This is probably more appropriate in one of the jobs-related channels. I’m ok with it here, unless it spawns a swarm of job hunting 🙂