Skip to content

Commit

Permalink
Format full defstate in README
Browse files Browse the repository at this point in the history
  • Loading branch information
aroemers committed Feb 17, 2024
1 parent 6afb802 commit a38a955
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,12 @@ If you want **metadata** on the State object, you can use `:meta` expression ins
So a full `defstate` could look like this:

```clj
(defstate ^:private my-state "my docs" {:extra "attr"}
:start (start-it ...)
(defstate ^:private my-state
"My docstring here."
{:extra "attributes"}
:start (start-it)
:stop (stop-it this)
:meta {:meta-score 42})
:meta {:score 42})
```

Next to metadata support, Clojure's `namespace` and `name` functions also work on states.
Expand Down

0 comments on commit a38a955

Please sign in to comment.