Fork me on GitHub
#hoplon
<
2017-07-20
>
cycle33708:07:19

I'm going to try to have a browser repl

cycle33708:07:44

can anyone suggest a nice hoplon integration (maybe a boot task) for a browser repl ?

cycle33709:07:49

now I'm trying to get adzerk cljs repl to work with hoplon ...

cycle33712:07:08

no progress

cycle33712:07:24

I identified the problem clearly

cycle33712:07:02

it's when I pass the cell to the elem I defined

cycle33712:07:29

somehow it comes as a non ISequable js object on the other end

cycle33712:07:23

the chain is this global app-state for admin ns --> lens selecting a single key which has a vector of maps --> passed that lens to defelem-ed function in a case-tpl --> lost the iSequability

cycle33712:07:45

I don't know what else to share besides the file contents above

cycle33712:07:01

admin.clj file 1/2:

(ns admin.dashview (:require [admin.edit-users :refer [user-edit-view]]))

(defc app-state {:modules {}
                           :choices {:top nil :bottom nil}}
                           :users-to-edit {})

(defn path-cell [c path]
  (cell= (get-in c path)
         (partial swap! c assoc-in path)))

(def all-users-cell (path-cell app-state [:users-to-edit]))

(defn get-all-users []
  (ajax-request {:uri "/api/users/"
                 :method :get
                 :handler (fn [[ok response]]
                            (if ok (dosync
                                     (reset! all-users-cell response))
                              (.error js/console (str response))))
                 :format (json-request-format)
                 :response-format (json-response-format {:keywords? true})}))

(case-tpl route
                 :users (div "users")
                 :edit-users (user-edit-view :users all-users-cell))
second file edit_users.clj 2/2
(ns admin.edit-users)

(defelem user-edit-view [{:keys [users]} _]
   (for-tpl [n (cell= users)]
      (div (cell= (:user_id n)))))