Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path ix comment #788

Merged
merged 1 commit into from
Aug 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion docs/Interceptors.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,14 @@ In advanced cases, these two values, within a `context`, can be modified by the
So interceptors can be dynamically added
and removed from `:queue` and `:stack` by Interceptors already in the chain.

## Self Documenting

An interceptor has a required `:id` key, and an optional `:comment` key.
Re-frame itself does not take any special action in response to these keys.
Instead, they can offer situational awareness to you or your tools.
For instance, the [standard interceptor](#appendix-built-in-interceptors)
__path__ adds a `:comment` describing _which_ path it goes to.

## Credit

> All truths are easy to understand once they are discovered <br>
Expand Down Expand Up @@ -392,7 +400,7 @@ And some Interceptor factories (functions that return Interceptors):

- __enrich__: perform additional computations (validations?), after the handler has run. More derived data flowing.
- __after__: perform side effects, after a handler has run. Eg: use it to report if the data in `app-db` matches a schema.
- __path__: a convenience. Simplifies our handlers. Acts almost like `update-in`.
- __path__: a convenience. Simplifies our handlers. Acts almost like `update-in`, to get and set a subtree of the app-db. Stores the path of the subtree in its `:comment`.

In addition, [a Library like re-frame-undo](https://github.com/day8/re-frame-undo) provides an Interceptor
factory called `undoable` which checkpoints app state.
Expand Down
Loading