Register a before-request hook. Returns the hook ID for ejection.
Register an after-request hook. Returns the hook ID for ejection.
Register a before-response hook. Returns the hook ID for ejection.
Register an after-response hook. Returns the hook ID for ejection.
Register an on-error hook. Returns the hook ID for ejection.
Register an on-retry hook. Returns the hook ID for ejection.
Register an on-redirect hook. Returns the hook ID for ejection.
Register an upload-progress hook. Returns the hook ID for ejection.
Register a download-progress hook. Returns the hook ID for ejection.
Register a cancel hook. Returns the hook ID for ejection.
Register a connection hook. Returns the hook ID for ejection.
Register an around hook. Returns the hook ID for ejection.
Remove a hook by ID from all phases. Returns true if any hook was removed.
Remove all hooks from all phases.
Check if a hook ID is registered in any phase.
Execute all before-request hooks in priority order. May mutate the request.
Execute all before-response hooks in priority order. May mutate the response.
Execute all on-error hooks. If any hook returns a HookResponse, it is treated as recovery and returned.
Execute all on-retry hooks.
Execute all on-redirect hooks. Returns false if any hook returns false (redirect should not be followed).
Execute all upload-progress hooks.
Execute all download-progress hooks.
Execute all on-cancel hooks.
Execute all on-connection hooks.
Wrap a dispatch function with all registered around hooks. Around hooks form an onion: outermost (lowest priority) wraps innermost.
Full-featured lifecycle hook registry supporting priority ordering, conditional execution, named hooks with ejection, and safe error isolation.
Phases: beforeRequest → afterRequest → around → [dispatch] → beforeResponse → afterResponse Error phase: onError (can recover with synthetic response) Side-event phases: onRetry, onRedirect, onUploadProgress, onDownloadProgress, onCancel, onConnection