3 ms·
This sounds like a case of simple, not easy: http://www.infoq.com/presentations/Simple-Made-Easy http://www.infoq.com/presentations/Simple-Made-Easy You could
by rads 13y ago
This sounds like a case of simple, not easy: http://www.infoq.com/presentations/Simple-Made-Easy http://www.infoq.com/presentations/Simple-Made-Easy
You could add a timestamp to each todo with two changes:
https://github.com/swannodette/todomvc/blob/gh-pages/labs/architecture-examples/om/src/todomvc/app.cljs#L101 https://github.com/swannodette/todomvc/blob/gh-pages/labs/ar...
(defn handle-new-todo-keydown [e {:keys [todos] :as app} owner]
...
(om/update! app [:todos] conj
{:id (guid) :title (.-value new-field)
:created-at (js/Date.) ;; <-- add this line
:completed false :order (count todos)})
...)
https://github.com/swannodette/todomvc/blob/gh-pages/labs/architecture-examples/om/src/todomvc/item.cljs#L48 https://github.com/swannodette/todomvc/blob/gh-pages/labs/ar...
(defn todo-item [{:keys [id title editing completed] :as todo} {:keys [comm]}]
...
;; change this line
(dom/label #js {:onDoubleClick #(handle-edit % todo m)} (str
(:title todo) (:created-at todo)))
...)