Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (re-frame/reg-cofx
- :local-store-todos
- (let [todos-output (r/atom (sorted-map))
- counter (r/atom 0)]
- (fn [cofx _]
- (GET GET_ALL_URL
- { :format :json
- :response-format :json
- :keywords? true
- :timeout 5000
- :handler
- (fn [resp]
- (when-let [todo-clauses (:ok resp)]
- (reset!
- todos-output
- (map #(do
- (swap! counter inc)
- (swap! todos-output into @counter {:id @counter :db_id (:id %) :title (:text %) :done (:done %)})) todo-clauses))))
- ;
- :error-handler
- (fn [err]
- (.error js/console "do-login:" (clj->js err)))})
- ;
- @todos-output)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement