diff --git a/Guide.adoc b/Guide.adoc index 78d12cb..4d85c12 100644 --- a/Guide.adoc +++ b/Guide.adoc @@ -649,7 +649,7 @@ on the chart itself, but defining actors at runtime: The above code defines a chart that will have `:fulcro/aliases` on the local data model because of the statechart definition, and will have a runtime value for the `:fulcro/actors` based -on data that was passed during start. Anthing initialized this way will go into the local data +on data that was passed during start. Anything initialized this way will go into the local data store (which is a path based on the session id in the app database). Changing aliases and actors on the fly is therefore a simple matter of doing an `op/assign` operation on diff --git a/src/examples/invocations.cljc b/src/examples/invocations.cljc index dcd9edd..1221049 100644 --- a/src/examples/invocations.cljc +++ b/src/examples/invocations.cljc @@ -88,7 +88,7 @@ (simple/send! env {:target session-id :event :swap}) - ;; With autoforard on, we can ferry events though to the child + ;; With autoforward on, we can ferry events though to the child (simple/send! env {:target session-id :event :child/swap}) diff --git a/src/main/com/fulcrologic/statecharts/event_queue/event_processing.cljc b/src/main/com/fulcrologic/statecharts/event_queue/event_processing.cljc index cb868ec..09a7663 100644 --- a/src/main/com/fulcrologic/statecharts/event_queue/event_processing.cljc +++ b/src/main/com/fulcrologic/statecharts/event_queue/event_processing.cljc @@ -19,7 +19,7 @@ (log/error "Session had no working memory. Event to session ignored" session-id))))) (defn process-events - "Processes events that are ready on the event queue. Syncrhonous. Returns as soon as the events + "Processes events that are ready on the event queue. Synchronous. Returns as soon as the events are complete." [{::sc/keys [processor working-memory-store event-queue] :as env}] (sp/receive-events! event-queue env diff --git a/src/main/com/fulcrologic/statecharts/event_queue/manually_polled_queue.cljc b/src/main/com/fulcrologic/statecharts/event_queue/manually_polled_queue.cljc index a8c61d1..e6b021e 100644 --- a/src/main/com/fulcrologic/statecharts/event_queue/manually_polled_queue.cljc +++ b/src/main/com/fulcrologic/statecharts/event_queue/manually_polled_queue.cljc @@ -1,6 +1,6 @@ (ns com.fulcrologic.statecharts.event-queue.manually-polled-queue "An event queue that does NOT process event delays via any kind of notification system. Delayed events will - be queued, and will be kept invisible until you ask for an event AFTER the timout of the event has occured. + be queued, and will be kept invisible until you ask for an event AFTER the timout of the event has occurred. This means you must manually poll this queue. This queue DOES support any number of sessions, and maintains separate tracking for each. @@ -12,7 +12,7 @@ This allows you to implement your delivery mechanism in concert with your overall system. - The `process-next-event!` of this implementation processes all available events in a loop and then returns." + The `receive-events!` of this implementation processes all available events in a loop and then returns." (:require [clojure.string :as str] [com.fulcrologic.statecharts :as sc] @@ -60,7 +60,7 @@ (fn [{event-send-id ::sc/send-id}] (= send-id event-send-id)) q))))) (receive-events! [this env handler] - ;; Run the events whose delivery time is before "now" for session-id + ;; Run the events whose delivery time is before "now" for all sessions registered (doseq [sid (keys @session-queues)] (sp/receive-events! this env handler {:session-id sid}))) (receive-events! [this env handler {:keys [session-id]}] @@ -83,7 +83,7 @@ (try (handler env event) (catch #?(:clj Throwable :cljs :default) e - (log/error e "Event handler threw an execption")))))))) + (log/error e "Event handler threw an exception")))))))) (defn new-queue [] (->ManuallyPolledQueue (atom {}))) diff --git a/src/main/com/fulcrologic/statecharts/events.cljc b/src/main/com/fulcrologic/statecharts/events.cljc index f03f521..060e133 100644 --- a/src/main/com/fulcrologic/statecharts/events.cljc +++ b/src/main/com/fulcrologic/statecharts/events.cljc @@ -87,5 +87,5 @@ (::sc/event-name event-or-name))) (def cancel-event - "An event anme that will cause the state machine to exit." + "An event name that will cause the state machine to exit." ::cancel) diff --git a/src/main/com/fulcrologic/statecharts/integration/fulcro.cljc b/src/main/com/fulcrologic/statecharts/integration/fulcro.cljc index b1a8cb7..3c0bb46 100644 --- a/src/main/com/fulcrologic/statecharts/integration/fulcro.cljc +++ b/src/main/com/fulcrologic/statecharts/integration/fulcro.cljc @@ -27,7 +27,7 @@ Future expressions would see the `:local` key in the `data` argument, and would also find the full Fulcro state map in `:fulcro/state-map`. - See also `fulcro.adoc` in this namespace folder. + See also 'Integration with Fulcro' in Guide.adoc. " (:require [com.fulcrologic.fulcro.algorithms.normalized-state :as fns] @@ -113,7 +113,7 @@ actor-names))) (>defn resolve-actor - "Returns the UI props of a single actor. Use env. `data` is allowed to prevent a non-breaking change, but doens't work + "Returns the UI props of a single actor. Use env. `data` is allowed to prevent a non-breaking change, but doesn't work when a non-even predicate is evaluated." [data-or-env actor-name] [[:or diff --git a/src/main/com/fulcrologic/statecharts/protocols.cljc b/src/main/com/fulcrologic/statecharts/protocols.cljc index e1b8cec..3b5f377 100644 --- a/src/main/com/fulcrologic/statecharts/protocols.cljc +++ b/src/main/com/fulcrologic/statecharts/protocols.cljc @@ -1,7 +1,7 @@ (ns com.fulcrologic.statecharts.protocols "Protocols for the various pluggable bits of this library: - Processor - A state machine processing algorithm. See com.fuclrologic.statecharts.algorithms. + Processor - A state machine processing algorithm. See com.fulcrologic.statecharts.algorithms. EventQueue - An external event queue for cross (and loopback) communication of machines and external services. DataModel - A model for saving/fetching data that can be directly manipulated by a state machine. ExecutionModel - A component that implements the interpretation of runnable code in the machine. diff --git a/src/main/com/fulcrologic/statecharts/simple.cljc b/src/main/com/fulcrologic/statecharts/simple.cljc index 532eeff..72150be 100644 --- a/src/main/com/fulcrologic/statecharts/simple.cljc +++ b/src/main/com/fulcrologic/statecharts/simple.cljc @@ -35,7 +35,7 @@ ``` (def env (simple-env)) - (env/register! env ::chart some-chart) + (register! env ::chart some-chart) (def processor (::sc/processor env)) (def s0 (sp/start! processor env ::chart {::sc/session-id 42})) (def s1 (sp/process-event! processor env s0 event)) diff --git a/src/main/com/fulcrologic/statecharts/testing.cljc b/src/main/com/fulcrologic/statecharts/testing.cljc index ae761d6..05a59ba 100644 --- a/src/main/com/fulcrologic/statecharts/testing.cljc +++ b/src/main/com/fulcrologic/statecharts/testing.cljc @@ -77,7 +77,7 @@ (not (fn? expr)) expr)))) (defn new-mock-execution - "Create a mock exection model. Records the expressions seen. If the expression has an + "Create a mock execution model. Records the expressions seen. If the expression has an entry in the supplied `mocks` map, then if it is a fn, it will be called with `env` which will contain the normal stuff along with `:ncalls` (how many times that expression has been called). Otherwise the value in the map is returned. @@ -113,7 +113,7 @@ (sent? [_ required-elements-of-send-request] "Checks that a send request was submitted that had at LEAST the elements of `required-elements-of-send-request` in it. If the value of an element in the - required elelments is a `fn?`, then it will be treated as a predicate.") + required elements is a `fn?`, then it will be treated as a predicate.") (cancelled? [_ session-id send-id] "Checks that an attempt was made to cancel the send with the given id.")) diff --git a/src/test/com/fulcrologic/statecharts/data_model/working_memory_data_model_spec.cljc b/src/test/com/fulcrologic/statecharts/data_model/working_memory_data_model_spec.cljc index 3f76222..0a5c18a 100644 --- a/src/test/com/fulcrologic/statecharts/data_model/working_memory_data_model_spec.cljc +++ b/src/test/com/fulcrologic/statecharts/data_model/working_memory_data_model_spec.cljc @@ -99,7 +99,7 @@ "Assignments are merged into the root, but paths work as assoc-in" (dissoc (::wmdm/data-model @vwmem) :z) => {:x 1 :y 42 :a {:b {:c 99} :c 100}} - "Special root paths are propertly processed" + "Special root paths are properly processed" (select-keys (::wmdm/data-model @vwmem) [:z]) => {:z 3})) (component "get-at"