Skip to content

Commit 93efc5a

Browse files
committed
[middleware] Guide updates
1 parent cac8707 commit 93efc5a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

site/guides/04_middleware.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,18 @@ custom validation, defaulting, and correction logic that is not easily captured
165165
in a plain type-based schema. Just be aware of the relationship between
166166
Middleware and schemas, and use that power wisely!
167167

168+
## When Middleware Is Not Called
169+
170+
There are two main cases where Middleware callbacks will not be called:
171+
172+
* When `doRollback` returns true at the end of a Store transaction: the
173+
transaction will be rolled back and no callbacks will be called on the changes
174+
that are made to the data to return it to its previous state.
175+
* When the Store is being updated from a checkpoint (using the checkpoint
176+
module): the changes from the checkpoint will be applied directly to the Store
177+
without calling any of the callbacks on the changes required to get it to the
178+
old 'undo' state or the new 'redo' state.
179+
168180
## Summary
169181

170182
Middleware gives you a powerful way to manipulate data coming into the Store,

0 commit comments

Comments
 (0)