Hi all, I'm stuck with this problem .. and need some help please I'm using realm from Js side to fetch some tasks objects , from console log everything seems fine. but this is how my db looks like from re-frisk ..
tasks {1 keys} ⎘
":2"[TaggedValue: ForeignType, ]
@abourkia.ab i'm not sure i understand the issue well.
Is it
[TaggedValue: ForeignType, ]
that look unfamiliar?yeah @trybeee that's unfamiliar to me I guess if i know what i means i will be able to fix it
Hi @abourkia.ab. Re-frisk is showing that a native JS type is in the database, not a cljs type. Try js->clj in your code to convert the type.
Hi @hadilsabbagh18.. I already had that 😕 but it didn't fix it for me ... this is how my code looks like
(reg-cofx
:tasks-storage
(fn [cofx _]
(let [tasks (js->clj (get-all-
tasks))]
(assoc cofx :tasks-storage tasks))))
(rf/reg-event-fx
:initialize-db
[(rf/inject-cofx :tasks-storage)]
(fn [{:keys [db tasks-storage]}]
{:db (or (when-not (empty? tasks-storage) (assoc initial-state :tasks tasks- storage))
initial-state)}))It is a nested JS structure. You need to extract the body of the js map and build the cljs map by hand.
I will give it a try .. I thought js->clj handles nested structures
Depends