Fork me on GitHub
#om
<
2016-04-26
>
jimmy03:04:39

@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.

jimmy04:04:59

@cky: welcome 😄

iwankaramazow05:04:57

@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...

iwankaramazow05:04:11

The nice thing about Om.Next is you have full control over everything.

devth13:04:22

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?

isak14:04:19

@iwankaramazow: interesting, ty for the details

devth14:04:43

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?

kendall.buchanan14:04:44

@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?

mattyulrich22:04:38

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}}

mattyulrich22:04:28

I’m invoking it as: (om/set-query! this {:params {:user-id userid}})

mattyulrich22:04:11

Is there something wrong with my query or how I’m trying to set the params?

mattyulrich22:04:14

Ok - sorry; looks like this is nothing to do with set-query, it’s happening even after I took set-query out.

isak22:04:09

@mattyulrich: are you messing with results from om/get-query anywhere? you may be losing the meta information that is needed by om

isak22:04:03

or do you have one component that is just taking the query from another component?