Skip to content

Commit

Permalink
Merge pull request #303 from paul-finary/doc/events
Browse files Browse the repository at this point in the history
doc(events): fix formatting and add documentation for Delete event
  • Loading branch information
roman-right authored Sep 28, 2022
2 parents 4139de1 + d7c4b76 commit 8cde50f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docs/tutorial/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,28 @@
You can register methods as pre- or post- actions for document events.

Currently supported events:

- Insert
- Replace
- Update
- SaveChanges
- Delete
- ValidateOnSave
- Update

Currently supported directions:

- `Before`
- `After`

Current operations creating events:

- `insert()` for Insert
- `replace()` Replace
- `save()` triggers Insert if it is creating a new document, triggers Replace it replaces existing document.
- `replace()` for Replace
- `save()` triggers Insert if it is creating a new document, triggers Replace if it replaces an existing document
- `save_changes()` for SaveChanges
- `insert()`, `replace()`, `save_changes()`, and `save()` for ValidateOnSave
- `set()`, `update()` for Update
- `delete()` for Delete

To register an action, you can use `@before_event` and `@after_event` decorators respectively:

Expand Down

0 comments on commit 8cde50f

Please sign in to comment.