Created
June 28, 2016 09:46
-
-
Save rauhs/3bf96b33f37f051859d5071cdde70148 to your computer and use it in GitHub Desktop.
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
(spec/def :datascript.db/id int?) | |
(spec/def :datomic.db/id #(instance? DbId %)) | |
(spec/def :db/id (spec/or :datascript :datascript.db/id | |
:datomic :datomic.db/id)) | |
(defn datomic-id? | |
"Checks a conformed spec and ensures the :db/id was a datomic id" | |
[{[kw] :db/id}] | |
(= kw :datomic)) | |
(defn datascript-id? | |
"Checks a conformed spec and ensures the :db/id was a datascript id" | |
[{[kw] :db/id}] | |
(= kw :datascript)) | |
(spec/def :object.abstract/schema (spec/keys :req [:db/id])) | |
(spec/def :object.from-client/schema | |
(spec/and :object.abstract/schema | |
datascript-id?)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment