This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn pull-many | |
"like Datomic pull, but takes a collection of ids and returns | |
a collection of entity maps" | |
([db pull-spec ids] | |
;; IMPLEMENTATION NOTE | |
;; | |
;; We use a Datomic query with a collection binding on the input to simulate pull-many. | |
;; This performs well even in distributed/development mode, as it's only 1 request over | |
;; the wire. If that was all there was to it, this function would be like 3 lines long, | |
;; but unfortunately it's a bit more difficult because the collection binding doesn't |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns ct-server.test-data | |
(:require [clojure.test :refer :all])) | |
(def user1 {:user/username "user1" | |
:user/email "[email protected]" | |
:user/public? false}) | |
(def user2 {:user/username "user2" | |
:user/email "[email protected]" | |
:user/public? false}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns core | |
(:require [fulcro.client.primitives :as prim] | |
[fulcro.client :as fc] | |
[fulcro.client.data-fetch :as df] | |
[fulcro.client.network :as net] | |
[expo :as expo] | |
[myapp.root :refer [MyRealFulcroRoot] | |
[support :as sup] | |
[oops.core :refer [ocall]])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn employee-menu [state event] | |
(let [open? (atom false)] | |
(subscribe-to event :show-employee-menu [_] | |
(reset! open? true)) | |
(subscribe-to event :hide-employee-menu [_] | |
(reset! open? false)) | |
(subscribe-to event :hide-left-menu [_] | |
(publish event :hide-employee-menu)) |