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
| ;;;; Macro definition | |
| (s/fdef defcommand | |
| :args (s/cat :name ::command-name | |
| :description (s/? ::command-description) | |
| :inputs ::command-inputs | |
| :forms (s/* ::command-form) | |
| :implementation ::command-implementation) | |
| :ret ::s/any) |
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 workflo.macros.command | |
| (:require [clojure.spec :as s] | |
| [clojure.spec.gen :as gen])) | |
| (s/def ::command-name | |
| symbol?) | |
| (s/def ::command-description | |
| string?) |
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
| {:onyx/name :redis | |
| :onyx/plugin :onyx.plugin.redis/writer | |
| :onyx/type :output | |
| :onyx/medium :redis | |
| :redis/uri "redis://localhost:6379" | |
| :onyx/batch-size batch-size} |
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
| boot.user=> (clojure.pprint/pprint onyx.plugin.redis/operations) | |
| {:exists #'taoensso.carmine/exists, | |
| :role #'taoensso.carmine/role, | |
| :ping #'taoensso.carmine/ping, | |
| :del #'taoensso.carmine/del, | |
| :zscan #'taoensso.carmine/zscan, | |
| :zremrangebyrank #'taoensso.carmine/zremrangebyrank, | |
| :lpushx #'taoensso.carmine/lpushx, | |
| :command-info #'taoensso.carmine/command-info, | |
| :mget #'taoensso.carmine/mget, |
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
| (do | |
| (om.next/defui | |
| User | |
| static | |
| om.next/IQuery | |
| (query | |
| [this] | |
| [({:user (om.next/get-query User)} '{:id ?user-id})])) | |
| (def user (workflo.macros.view/factory User {})) | |
| (workflo.macros.view/register-view! 'User {:factory user, :view User})) |
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
| ;;;; Test code | |
| (require '[clojure.spec :as s]) | |
| (s/def ::simple-value | |
| symbol?) | |
| (s/def ::link-value | |
| (s/tuple symbol? any?) | |
| #_(s/tuple symbol? keyword?) |
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
| (comment | |
| ;;;; Non-recursive queries | |
| ;; Regular property | |
| (s/conform ::query '[a]) | |
| (s/conform ::query '[a b]) | |
| (s/conform ::query '[a b c]) | |
| ;; Link property | |
| (s/conform ::query '[[a _]]) |
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
| (deftest conforming-regular-properties | |
| (are [out in] (= out (q/conform in)) | |
| '[[:property [:simple a]]] | |
| '[a] | |
| '[[:property [:simple a]] | |
| [:property [:simple b]]] | |
| '[a b] | |
| '[[:property [:simple a]] |
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
| boot.user=> (clojure.spec/def ::foo (clojure.spec/with-gen ::bar #(clojure.spec.gen/symbol))) | |
| :boot.user/foo | |
| boot.user=> (clojure.spec/describe :boot.user/foo) | |
| :clojure.spec/unknown | |
| boot.user=> (clojure.spec/def ::bar symbol?) | |
| :boot.user/bar | |
| boot.user=> (clojure.spec/describe :boot.user/foo) | |
| :clojure.spec/unknown |
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
| ;;;; Deep destructuring characteristics | |
| ;; Regular properties | |
| Query: [a b] | |
| Result: {:a <aval> :b <bval>} | |
| Bindings: | |
| a -> <aval> | |
| b -> <bval> |