~sjm/redwood

ref: 8739a8f9f85d3ee990c60f9a5457c9ac534ada1e redwood/src/redwood/data/journal.cljs -rw-r--r-- 285 bytes
8739a8f9Sam Marshall add timestamped journal 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(ns redwood.data.journal
  (:require [clojure.spec.alpha :as s]
            [cljs-time.core :as t]))

(s/def ::time t/date?)

(s/def ::contents string?)

(s/def ::entry
  (s/keys :req [::time ::contents]))

(defn create-entry
  [time contents]
  {::time time
   ::contents contents})