Fork me on GitHub
#arachne
<
2018-03-01
>
amarjeet12:03:54

Hi @luke, in FactUI, if I use rum/defc to create rum components, then (fr/transact! app-state [...]) works good. But, if I use rum/defcs then, I get this error while transacting (Error: No protocol method ISwap.-swap! defined for type cljs.core/PersistentArrayMap: {:rum/args (#object [cljs.core.Atom {:val #factui.impl.session.DatomSession{:delegate #object[clara.rules.engine.LocalSession], :store #factui.impl.store.SimpleStore{:schema {:segment/id {:db/cardinality :db.cardinality/one, :db/valueType :db.type/string}, :localState/name {:db/cardinality :db.cardinality/one, :db/valueType :db.type/string}, :db/index {:db/cardinality :db.cardinality/one, :db/valueType :db.type/boolean}, :book/authors {:db/cardinality :db.cardinality/many, :db/valueType :db.type/ref}, :db/unique {:db/cardinality :db.cardinality/one, :db/valueType :db.type/keyword}, :user/membershipId {:db/cardinality :db.cardinality/one, :db/valueType :db.type/string}, :book/isbn {:db/cardinality :db.cardinality/one, :db/valueType :db.type/string}, :relation/src-entity {:db/cardinality :db.cardinality/one, :db/valueType :db.type/ref}, :currentState/state {:db/cardinality :db.cardinality/one, :db/value…) I am using rum/defcs because I wanted to use my own mixins.

luke13:03:31

FactUI’s state is different from Rum’s state. It might be the case that FactUI is not (currently) compatible with defcs. Reason being, both of those impose special meaning on the first argument to render

luke13:03:43

I’d have to dive in to the internals of both to figure out if there’s a way to reconcile them

luke13:03:53

It might work to just pass them both

amarjeet13:03:04

Is there a way to get data from a network cal and use it as mixin so that the component can subscribe to that mixin?

amarjeet13:03:48

both means - app-state and state

luke13:03:50

(rum/defcs <mixins>
   [rum-state factui-state]
   ....
`

luke13:03:53

yeah something like that

amarjeet13:03:01

okay, let me try

luke13:03:16

it should be possible in theory to have a component with both rum state and factui state

luke13:03:28

I don’t remember off the top of my head how rum state works

luke13:03:45

unfortunately I won’t have time to look closely today

luke13:03:03

but I bet if you look at the implementation for rum/defc and for FactUI’s mixin, you’ll be able to figure it out

amarjeet13:03:09

oh, the two state funda worked

amarjeet13:03:32

[rum-state factui-state] style

amarjeet13:03:46

this is a relief 🙂

luke13:03:59

hopefully the update semantics work out to be what you were hoping for

luke13:03:09

might be worth some testing