arachne

Project Page: http://arachne-framework.org/ Kickstarter: https://www.kickstarter.com/projects/1346708779/arachne-rapid-web-development-for-clojure
amarjeet 2018-03-01T12:25:54.000201Z

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.

luke 2018-03-01T13:37:31.000183Z

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

luke 2018-03-01T13:37:43.000506Z

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

amarjeet 2018-03-01T13:38:20.000327Z

okay

luke 2018-03-01T13:38:53.000354Z

It might work to just pass them both

amarjeet 2018-03-01T13:39:04.000533Z

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?

amarjeet 2018-03-01T13:39:48.000075Z

both means - app-state and state

amarjeet 2018-03-01T13:39:49.000441Z

?

luke 2018-03-01T13:39:50.000109Z

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

luke 2018-03-01T13:39:53.000310Z

yeah something like that

amarjeet 2018-03-01T13:40:01.000111Z

okay, let me try

luke 2018-03-01T13:40:16.000526Z

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

luke 2018-03-01T13:40:28.000581Z

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

luke 2018-03-01T13:40:45.000106Z

unfortunately I won’t have time to look closely today

luke 2018-03-01T13:41:03.000534Z

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

amarjeet 2018-03-01T13:42:09.000673Z

oh, the two state funda worked

amarjeet 2018-03-01T13:42:32.000560Z

[rum-state factui-state] style

luke 2018-03-01T13:42:38.000233Z

cool

amarjeet 2018-03-01T13:42:46.000444Z

this is a relief 🙂

amarjeet 2018-03-01T13:42:48.000032Z

thanks

luke 2018-03-01T13:42:51.000092Z

np

luke 2018-03-01T13:42:59.000200Z

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

luke 2018-03-01T13:43:09.000189Z

might be worth some testing

amarjeet 2018-03-01T13:43:14.000457Z

yeah 🙂