From 61b66d4349fc8293b224ae38acf418fd4b068e33 Mon Sep 17 00:00:00 2001 From: ingesolvoll Date: Fri, 19 Nov 2021 12:49:41 +0100 Subject: [PATCH] Namespaced open? options To avoid future namespace pollution with statecharts --- README.md | 2 +- src/re_statecharts/core.cljc | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f3a933b..84fbdfe 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ Here's an example: ```clojure (def open-validation-fsm - ^{:open? true} + ^{::rs/open? true} {:id :validation-open :initial ::clean :states {::clean {:on {::edit-started ::editing}} diff --git a/src/re_statecharts/core.cljc b/src/re_statecharts/core.cljc index 15281f6..22a5077 100644 --- a/src/re_statecharts/core.cljc +++ b/src/re_statecharts/core.cljc @@ -117,9 +117,10 @@ (defn integrate ([machine] (integrate machine sc.rf/default-opts)) - ([{:keys [id] :as machine} {:keys [clock] :as opts}] + ([{:keys [id] :as machine} + {::keys [open?] + :keys [clock] :as opts}] (let [clock (or clock (clock/wall-clock)) - open? (:open? opts) machine (assoc machine :scheduler (Scheduler. id (atom {}) clock open?)) transition-opts (cond-> (:transition-opts opts) open? (assoc :ignore-uknown-events? true))]