(ns lineup.subs
  (:require
   [re-frame.core :as re-frame]))

(re-frame/reg-sub
 ::mode
 (fn [db]
   (:mode db)))

(re-frame/reg-sub
 ::schedule
 (fn [db]
   (:schedule db)))

(re-frame/reg-sub
 ::complete
 (fn [db]
   (->> db
        :schedule
        :tasks
        (every? :complete?))))

(re-frame/reg-sub
 ::library
 (fn [db]
   (:library db)))

(re-frame/reg-sub
 ::selecting
 (fn [db]
   (:selecting db)))
