Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/cljs/precept/todomvc/facts.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
(defn todo [title]
(let [id (random-uuid)]
[[id :todo/title title]
[id :todo/entered-at (.getTime (js/Date.))]
[id :todo/done false]]))

3 changes: 3 additions & 0 deletions src/cljs/precept/todomvc/schema.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
:db.type/string
:db/unique :db.unique/identity)

(attribute :todo/entered-at
:db.type/long)

(attribute :todo/done
:db.type/boolean)])

Expand Down
2 changes: 1 addition & 1 deletion src/cljs/precept/todomvc/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
{:for "toggle-all"}
"Mark all as complete"]
[:ul#todo-list
(for [todo visible-todos]
(for [todo (reverse (sort-by :todo/entered-at visible-todos))]
^{:key (:db/id todo)} [todo-item todo])]]))

(defn footer []
Expand Down