Skip to content

(mount/stop state) does not rollback! the state #124

@socksy

Description

@socksy

Hi there, I think this is a problem with a missing var-to-str but I can't work out exactly where that should be.

Basically, if you shadow some state, you should expect it to reset when doing mount/stop, but it doesn't.

(require '[mount.core :as mount])
(mount/defstate foo :start :foo)
(mount/start-with-states 
  {#'foo {:start (constantly :bar)
          ;; to get it to even be able to be stopped when given to (mount/stop)
          :stop (constantly nil)}})
(println foo) ;; => :bar

;; unexpected behaviour
(mount/stop #'foo)
(mount/start)
(println foo) ;; => :bar

;; workaround
(mount/stop "#'user/foo")
(mount/start)
(println foo) ;; => :foo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions