Skip to content

Commit

Permalink
Minor documentation updates (#5)
Browse files Browse the repository at this point in the history
- Including typos
  • Loading branch information
danieroux authored Aug 20, 2024
1 parent dc9ba59 commit 5dc803e
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/examples/invocations.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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]
Expand Down Expand Up @@ -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]}]
Expand All @@ -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 {})))
Expand Down
2 changes: 1 addition & 1 deletion src/main/com/fulcrologic/statecharts/events.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions src/main/com/fulcrologic/statecharts/integration/fulcro.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/com/fulcrologic/statecharts/protocols.cljc
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/main/com/fulcrologic/statecharts/simple.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions src/main/com/fulcrologic/statecharts/testing.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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."))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5dc803e

Please sign in to comment.