Skip to content

r.hook(...)

r.hook(type, target, fn, options?) — attaches a lifecycle hook (validation, preSave, postSave, preDelete, postDelete, preQuery, postQuery) to one or more target handlers. Post-hooks accept a phase option; preDelete always runs in-transaction — it guards the delete. The hook body is an opaque code span.


From packages/framework/src/engine/feature-ast/patterns.ts -> HookPattern