Roman Volosovskyi b746bcef4f attempt to fix performance issues
Former-commit-id: 3a93e0890bfea4b167b934c26f2c5096ea73421a
2016-06-30 17:23:38 +03:00

25 lines
701 B
Clojure

(ns status-im.participants.handlers
(:require [status-im.navigation.handlers :as nav]
[re-frame.core :refer [debug]]
[status-im.utils.handlers :refer [register-handler]]))
(defmethod nav/preload-data! :add-participants
[db _]
(assoc db :selected-participants #{}))
(defmethod nav/preload-data! :remove-participants
[db _]
(assoc db :selected-participants #{}))
(defn deselect-participant
[db [_ id]]
(update db :selected-participants disj id))
(register-handler :deselect-participant deselect-participant)
(defn select-participant
[db [_ id]]
(update db :selected-participants conj id))
(register-handler :select-participant (debug select-participant))