(ns lt.objs.notifos
  (:require [lt.object :as object]
            [lt.objs.statusbar :as statusbar]
            [lt.objs.command :as cmd]
            [lt.util.js :refer [wait]]
            [crate.binding :refer [map-bound bound deref?]])
  (:require-macros [lt.macros :refer [behavior defui]]))

(def standard-timeout 10000)

(defn working [msg]
  (when msg
    (set-msg! msg))
  (statusbar/loader-inc))

(defn done-working
  ([]
   (statusbar/loader-dec))
  ([msg]
   (set-msg! msg)
   (statusbar/loader-dec)))

(defn msg* [m opts]
  (let [m (if (string? m)
            m
            (pr-str m))]
    (object/merge! statusbar/statusbar-loader (merge {:message m :class ""} opts))))

(defn set-msg! [msg opts]
  (msg* msg opts)
  (js/clearTimeout cur-timeout)
  (set! cur-timeout (wait standard-timeout #(msg* ""))))

(cmd/command {:command :reset-working
              :desc "Statusbar: Reset working indicator"
              :exec (fn []
                      (statusbar/loader-set 0)
                      )})

(ns lt.objs.notifos
  (:require [lt.object :as object]
            [lt.objs.statusbar :as statusbar]
            [lt.objs.command :as cmd]
            [lt.util.js :refer [wait]]
            [crate.binding :refer [map-bound bound deref?]])
  (:require-macros [lt.macros :refer [behavior defui]]))

(def standard-timeout 10000)

(defn working [msg]
  (when msg
    (set-msg! msg))
  (statusbar/loader-inc))

(defn done-working
  ([]
   (statusbar/loader-dec))
  ([msg]
   (set-msg! msg)
   (statusbar/loader-dec)))

(defn msg* [m & [opts]]
  (let [m (if (string? m)
            m
            (pr-str m))]
    (object/merge! statusbar/statusbar-loader (merge {:message m :class ""} opts))))

(defn set-msg! [msg opts]
  (msg* msg opts)
  (js/clearTimeout cur-timeout)
  (set! cur-timeout (wait standard-timeout #(msg* ""))))

(cmd/command {:command :reset-working
              :desc "Statusbar: Reset working indicator"
              :exec (fn []
                      (statusbar/loader-set 0)
                      )})

Make msg* opts argument optional
Make msg* opts argument optional

To avoid compiler warnings, change the opts argument of notifos/msg* into an optional one.

craftybones/LightTable,bruno-oliveira/LightTable,craftybones/LightTable,masptj/LightTable,youprofit/LightTable,brabadu/LightTable,hiredgunhouse/LightTable,fdserr/LightTable,kausdev/LightTable,BenjaminVanRyseghem/LightTable,masptj/LightTable,kolya-ay/LightTable,EasonYi/LightTable,ashneo76/LightTable,pkdevbox/LightTable,BenjaminVanRyseghem/LightTable,LightTable/LightTable,windyuuy/LightTable,0x90sled/LightTable,ohAitch/LightTable,hiredgunhouse/LightTable,ohAitch/LightTable,youprofit/LightTable,Bost/LightTable,kolya-ay/LightTable,kenny-evitt/LightTable,cldwalker/LightTable,pkdevbox/LightTable,LightTable/LightTable,ashneo76/LightTable,mrwizard82d1/LightTable,hiredgunhouse/LightTable,nagyistoce/LightTable,mpdatx/LightTable,0x90sled/LightTable,mpdatx/LightTable,windyuuy/LightTable,mpdatx/LightTable,0x90sled/LightTable,ashneo76/LightTable,justintaft/LightTable,BenjaminVanRyseghem/LightTable,rundis/LightTable,kenny-evitt/LightTable,pkdevbox/LightTable,mrwizard82d1/LightTable,kausdev/LightTable,rundis/LightTable,fdserr/LightTable,rundis/LightTable,masptj/LightTable,EasonYi/LightTable,brabadu/LightTable,craftybones/LightTable,kausdev/LightTable,EasonYi/LightTable,mrwizard82d1/LightTable,windyuuy/LightTable,kenny-evitt/LightTable,sbauer322/LightTable,brabadu/LightTable,fdserr/LightTable,LightTable/LightTable,justintaft/LightTable,sbauer322/LightTable,Bost/LightTable,ohAitch/LightTable,sbauer322/LightTable,cldwalker/LightTable,youprofit/LightTable,kolya-ay/LightTable,Bost/LightTable,nagyistoce/LightTable,bruno-oliveira/LightTable,nagyistoce/LightTable,bruno-oliveira/LightTable