aroemers / mount-lite

mount, but different and light
https://cljdoc.org/d/functionalbytes/mount-lite/
Eclipse Public License 1.0
102 stars 8 forks source link

Add :up-to option to start and stop #1

Closed aroemers closed 8 years ago

aroemers commented 8 years ago

An :up-to option would start the given state var, and all state vars with a lower order number (starting with the lowest). Or it would stop the given state var, and all state vars with a higher order (starting with the highest).

This composes well with the :except option and :substitute option. Not so much with the :only option, though.

Of course, a convenience/API function called up-to can be supplied.

Example:

(defstate a :start nil)
(defstate b :start nil)
(defstate c :start nil)

(start (up-to #'b))
;=> (#'user/a #'user/b)

(start)
;=> (#'user/c)

(stop (up-to #'b))
;=> (#'user/c #'user/b)