This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-26
Channels
- # 100-days-of-code (3)
- # announcements (2)
- # beginners (237)
- # bitcoin (2)
- # boot (5)
- # cider (15)
- # cljs-dev (9)
- # cljsrn (6)
- # clojure (75)
- # clojure-estonia (1)
- # clojure-italy (8)
- # clojure-losangeles (1)
- # clojure-nl (1)
- # clojure-spec (68)
- # clojure-uk (80)
- # clojurescript (89)
- # cursive (31)
- # datomic (22)
- # emacs (2)
- # events (3)
- # figwheel-main (184)
- # fulcro (28)
- # graphql (1)
- # hyperfiddle (2)
- # jobs (1)
- # jobs-discuss (64)
- # luminus (5)
- # off-topic (16)
- # om (2)
- # onyx (1)
- # pedestal (12)
- # portkey (1)
- # re-frame (13)
- # reagent (56)
- # reitit (13)
- # ring-swagger (13)
- # shadow-cljs (145)
- # slack-help (2)
- # specter (6)
So… i’m trying to use the form-state stuff, but whenever i call entity->pristine*
, i end up with a weird nil entry in the top level of my db, with a copy of my db as the value of that nil entry. Any ideas as to why this is happening?
{:foo :bar}
becomes
{nil {:foo :bar}
:foo :bar}
Ah, nvm. Figured it out. Looks like if I am going to use fs to edit an existing entity that i get from the server, I have to wrap the incoming data with fs/add-form-config
is it possible to dispatch mutation based on keyword (:keyword) not a symbol?
nope, but wondering why would you want that?
first there is no need in quoting also frontend and backend can have mutations in different namespaces
why would I want it to be a symbol?
the reason is to separated the "spaces" of it, you can think that keywords are always a unit of read
, they are about data, while symbols are like functions, they imply something will happen, more like some operation
kind like using keywords to read data from maps while symbols call functions
k, reasoning seems clear. Cant say I think such separation is needed, but it makes sense… is it possible to have mutations in different namespaces on front/back end?
yeah, think as symbol ns as same as kw ns, you can use any of then anywhere
and what jonny said, you can change the symbol before sending to server
but then frontend should kinda know about backend structure?
got it
it is not related to code structure
eg employee/update symbol same as :employee/update keyword
it doesnt meen update mutation should be inside employee names, it is just a key used in multimethod
right?
@U1V7K1YTZ Also look at this issue: https://github.com/fulcrologic/fulcro/issues/238 It discusses some ideas about how to code things so you don't need quoting.
thanks
hey, there is perhaps silly questions, I was trying to use localised-dom
and it work as long I put css into defsc
. when I extract it to def
and reference it it immediately breaks o.O
I was thinking about to use localised css but keep css in seperate files or just in other part of file, as usually when you read the logic you are not concern about styling.
any ideas what I can do wrong? should I just create example project illustrating this issue and add ticket?
@sihingkk The localized DOM elements work by looking at a dynamic var that holds the “currently rendering” component.