                                             :in-timeout 1000}))
 
 (def state-comp (toolbox/make-component c/make-state c/handle-incoming nil))
-
+(def state-pub (pub (:sliding-out-chan state-comp) first)) ; Pub for subscribing to
 
 (def wc-c-comp (toolbox/single-in-single-out (partial wc-c/init-component 25)
                                              {:in-chan [:sliding 1]

                                              :out-chan [:buffer 1]
                                              :in-timeout 5000}))

(sub state-pub :app-state (:in-chan wc-c-comp))
(pipe (:out-chan wc-c-comp) state-in-chan)

(sub state-pub :app-state (:in-chan ts-comp))
(pipe (:out-chan ts-comp) state-in-chan)

(sub state-pub :app-state (:in-chan wc-comp))
(pipe (:out-chan wc-comp) state-in-chan)

(pipe state-in-chan (:in-chan state-comp))
(pipe (:out-chan state-comp) qry-chan)
(pipe (:sliding-out-chan state-comp) state-pub-chan)

;;; Initialization of WebSocket communication.
(def ws-comp (toolbox-ws/component))
(pipe (:out-chan ws-comp) state-in-chan)
(pipe qry-chan (:in-chan ws-comp))

(def tweets-comp (toolbox/single-in-single-out tw/init-component))
(sub state-pub :app-state (:in-chan tweets-comp))
(pipe (:out-chan tweets-comp) state-in-chan)

(toolbox-r/init-components state-pub state-in-chan
                           [[cv/count-view "tweet-count"] [cv/users-count-view "users-count"]
                            [cv/total-count-view "total-tweet-count"] [sv/search-view "search"]
                            [pag/pagination-view "pagination"] [st/sort-view "sort-buttons"]])

;;;; Main file of the BirdWatch client-side application.

;;; Channels for handling information flow in the application.
(def state-pub-chan (chan (sliding-buffer 1))) ; Publication of state changes.

(def ts-comp (toolbox/single-in-single-out ts-c/init-component
                                           {:in-chan [:sliding 1]
