Available since v0.1.0
fs-trigger="unmount"
StableFires when the element is removed from the DOM. Use for cleanup validation — verify that removing a feature also removes its side effects.
Syntax
<div class="modal"
fs-assert="modal/unmount-cleanup"
fs-trigger="unmount"
fs-assert-removed=".backdrop">
</div>
When to use it
- Cleanup validation when a section is torn down (modals, drawers, lazy-loaded pages)
- "When X disappears, Y should also disappear" contracts
Example
<div id="editor-panel"
fs-assert="editor/unmount-saves-draft"
fs-trigger="unmount"
fs-assert-added=".draft-saved-toast">
</div>
When the editor panel is removed, assert that a "draft saved" toast appears elsewhere.
Pairs well with
fs-assert-removed— verify a related element is gonefs-assert-added— verify a cleanup notification appearedfs-assert-after— sequence check against a prior close action
Gotchas
- Timing. The assertion is created at the moment of removal. If the side effect happens in the same microtask, use OOB with
fs-assert-oob-failor a different trigger — unmount is a commit moment, not a window. - Full page unloads don't fire unmount. The agent's unload grace-period model takes over (see timeout).
See also
mount— the complementary trigger- OOB assertions — for side-effect validation
- Triggers index