Skip to content

Commit

Permalink
Add example watchpoint code in README
Browse files Browse the repository at this point in the history
  • Loading branch information
aroemers authored Feb 11, 2024
1 parent 6dc522a commit 6a71d29
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ The library has a public `watchpoint` var.
You can watch this var by using Clojure's `add-watch`.
The registered watch functions receive `:starting`, `:started`, `:stopping` or `:stopped` and the State object.

Try the following example:

```clj
(add-watch redelay.core/watchpoint :my-logger prn)
```

You can do all kinds of things with this watchpoint, such as logging or keeping track of states yourself.
So if you want to have more sophisticated stop logic with separate buckets/systems of states using their metadata for example?
Go for it, be creative and use the library's building blocks to fit your perfect workflow!
Expand Down

0 comments on commit 6a71d29

Please sign in to comment.