This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-27
Channels
- # aleph (1)
- # aws (2)
- # beginners (69)
- # boot (79)
- # braid-chat (1)
- # cider (221)
- # clara (13)
- # cljs-dev (9)
- # cljs-edn (1)
- # cljsrn (7)
- # clojure (128)
- # clojure-chicago (1)
- # clojure-russia (196)
- # clojure-sanfrancisco (1)
- # clojure-uk (13)
- # clojurescript (166)
- # community-development (2)
- # css (2)
- # cursive (8)
- # datomic (4)
- # emacs (11)
- # hoplon (54)
- # instaparse (2)
- # jobs (16)
- # jobs-discuss (54)
- # jobs-rus (7)
- # luminus (4)
- # off-topic (33)
- # om (37)
- # onyx (8)
- # proton (10)
- # quil (8)
- # re-frame (29)
- # reagent (7)
- # remote-jobs (2)
- # untangled (140)
- # yada (1)
I do have a hierarchy of components… Just stripped it down to the minimum and I still see it:
App-Root has a query of ‘[:user]
and creates an App-Header (header om/props this)
; Header has a query of ’[:user]
and creates a Login-Component (login om/props this)
; Login-Component has a query of ’[:user]
…. There’s no complaint when the page loads and app-state is empty; but when a user logs in and I mutate the app-state to add :user, I get that error.
you can see how, starting with App-Root, there is a 'path' in the queries to Header and then to Login with get-query. this is what the error is complaining about -- you don't have that in your queries
Ok… I think this makes a lot more sense… I don’t think I’ve really gotten a handle on the query syntax; what ‘get-query’ returns and where it fits. I’ll play with this; thanks for the feedback!
@kendall.buchanan: if you want to mix the project, your best bet is to mount react component to om. I have heard that CapitalOne has tried the approach of using both cljs and js. I'm not so sure about their approach and how they did it ( curious to know too )
Hello People, I'm trying to use a parameterized query with Om alpha-34 but I'm getting an error:
(om/query->ast [({:some/key [:sub/key]} {:arg :foo})])
-> #error {:message "Invalid expression ", :data {:type :error/invalid-expression}}
I'm pretty sure it was working before, does someone else can reproduce that?
@wilkerlucio: try quoting the query?
you need to actually do that because of ()
@anmonteiro: oh, you right, thank you
sorry, missed that big time
welcome
i'm using om's default-merge
in my reconciler. should i expect :tempids
maps from remote mutations to automatically be resolved in my app state?
looking for advice on how to do advanced compilation with om.next. When i simply try the :advanced compiler option, i get this error:
goog.require could not find: cljsjs.react
You should not need to add cljsjs.react manually, but om.next depends on it. Try this in :dependencies
[org.omcljs/om "1.0.0-alpha32"
:exclusions [[cljsjs/react]
[cljsjs/react-dom]]]
[cljsjs/react "15.0.1-1"]
[cljsjs/react-dom "15.0.1-1"]
@devth: you might check default-migrate
instead of default-merge
😄
Has anyone attempted passing an api key/token from app-state to their send function? Is the best way to merge in the token into the ast...i.e. {:server-api-remote (assoc ast :api-remote-token (get st :api-token))}...?
@tmorten I've done it by merging into the ast's params (update ast :params merge {:api-remote-token (get st :api-token)} params)
Is it ok to call transact!
inside componentWillMount
?
assuming the mutation will not cause the component to remount?
@nxqd: yes, I set request headers in my send method. Similar to the om-next-todo demo application
I'm just thinking once someone "logs" most would save the api-token to the application state...so from the app state, I was wondering what best practices are in getting that to the actual send method to update the request headers...
@tmorten: send
is a function, if you pass the reconciler in it, you have access to the state
@iwankaramazow: That is an even better idea...there maybe a few other things I'd like to send in the request as well...
@tmorten: passing the reconciler to send is a bit tricky in terms of circular dependencies, you could try something like this:
(defn make-reconciler
[{:keys [state parser merge merge-tree migrate id-key]}]
(let [escape-hatchet (atom nil)
config {:state state
:parser parser
:migrate migrate
:id-key id-key
:merge merge
:merge-tree merge-tree
:send (transit-post "/api" (assoc {} :reconciler escape-hatchet))}
reconciler (om/reconciler config)]
(reset! escape-hatchet reconciler)
reconciler))