This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-26
Channels
- # admin-announcements (4)
- # beginners (3)
- # boot (78)
- # cider (13)
- # cljs-dev (29)
- # cljs-edn (8)
- # cljsjs (11)
- # cljsrn (15)
- # clojure (81)
- # clojure-beijing (2)
- # clojure-belgium (3)
- # clojure-canada (1)
- # clojure-dusseldorf (8)
- # clojure-greece (6)
- # clojure-russia (40)
- # clojure-sg (1)
- # clojure-uk (59)
- # clojurebridge (1)
- # clojurescript (101)
- # core-logic (1)
- # cursive (3)
- # data-science (1)
- # datomic (60)
- # emacs (4)
- # error-message-catalog (12)
- # funcool (1)
- # hoplon (60)
- # jobs (1)
- # jobs-discuss (40)
- # leiningen (5)
- # liberator (1)
- # mount (22)
- # off-topic (8)
- # om (16)
- # onyx (53)
- # re-frame (11)
- # reagent (2)
- # specter (4)
- # testing (18)
- # untangled (51)
@kendall.buchanan: I dont think so . Om clojurescript wrapper does have some special variables and lifecycle that only exist in om, it wouldn't work fine with reactjs.
@isak: it depends on the exact scenario, but it'll mostly work. e.g. the [(redirect-to-dashboard!)]
has some logic: is an authenticated user in the state (w/ response merged in) ? if so, redirect... else set an error-marker in the state that will render the corresponding forms dirty.
The error-part is handled with another mutation...
The nice thing about Om.Next is you have full control over everything.
@stex: check out https://github.com/untangled-web/untangled-client/blob/master/src/untangled/client/data_fetch.cljs
i need to reset a form after a user hits submit. i thought this would work: (om/set-state! c (.initLocalState c))
but it doesn't clear the form, and causes an error on subsequent form edits: No protocol method IAssociative.-assoc defined for type object: [object Object]
is there a better way?
@iwankaramazow: interesting, ty for the details
apparently the response of a remote mutations is merged into app state under mutation-key / :result
. do i need to write a custom merge in order to merge it into some other known coordinates in the state tree?
@nxqd: Thanks for the response. If I wanted to mix two projects, might it be best for me to simply mount Om in a DOM element somewhere, and manage it separately?
I’m still getting my head around how this all works; when I call om.next/set-query! from the render function of the component on which I’m setting the query, I get the following error:
Uncaught #error {:message "No queries exist for component path (rootns.app/App-Root rootns.ui/App-Header rootns.ui/Login-Component)", :data {:type :om.next/no-queries}}
I’m invoking it as: (om/set-query! this {:params {:user-id userid}})
Is there something wrong with my query or how I’m trying to set the params?
Ok - sorry; looks like this is nothing to do with set-query, it’s happening even after I took set-query out.
@mattyulrich: are you messing with results from om/get-query anywhere? you may be losing the meta information that is needed by om