mirror of
https://github.com/status-im/re-frame-10x.git
synced 2026-08-31 12:01:10 +00:00
26 lines
1.0 KiB
Markdown
26 lines
1.0 KiB
Markdown
### Event Handler Tracing
|
|
|
|
This panel provides an interactive, explorative UI through which you can browse the form-by-form execution trace of the ClojureScript code in your event handlers. You can inspect the data produced by every ClojureScript form, while retaining overall context.
|
|
|
|
### Show Me
|
|
|
|
Here's what it would look like if you had it setup:
|
|
|
|

|
|
|
|
### Setup
|
|
|
|
**First**, adjust your `project.clj` by following [these instructions](https://github.com/Day8/re-frame-debux/blob/master/README.md#installation) to add `day8.re-frame/debux` to the `:dev` `:dependencies`.
|
|
|
|
**Then**, within the namespace of yours which contains the event handlers to be traced (perhaps called `events.cljs`):
|
|
|
|
1. Add the following `:require` to the `ns`: `[debux.cs.core :refer-macros [fn-traced]]`
|
|
2. When you register your event handler, use `fn-traced` instead of `fn`, like this:
|
|
|
|
```clj
|
|
(reg-event-db
|
|
:some-id
|
|
(fn-traced [db event] ;; <-- notice the use of `fn-traced` instead of `fn`
|
|
... code in here))
|
|
```
|