GlobalBehaviorsOptions
Αυτό το περιεχόμενο δεν είναι ακόμη διαθέσιμο στη γλώσσα σου.
Defined in: packages/pipeline/src/options/global-behaviors.options.ts:38
Configuration for behaviors that are automatically applied to all Commands, Queries, and/or Events, regardless of the entries declared at a call site.
Execution order:
[before] → [call-site behaviors] → [after] → handler. If the same
behavior class is declared globally and at a call site, it runs once at its
global position with the call-site options merged over the global ones.
Example
Section titled “Example”// Single objectcreatePipeline({ globalBehaviors: { scope: 'all', before: [LoggingBehavior, [MetricsBehavior, { meterName: 'api' }]], after: [AuditBehavior], },});
// Array — different scopes for different request kindscreatePipeline({ globalBehaviors: [ { scope: 'commands', before: [AuditBehavior] }, { scope: 'queries', before: [CacheBehavior] }, { scope: 'all', after: [LoggingBehavior] }, ],});Properties
Section titled “Properties”after?
Section titled “after?”
optionalafter?:PipelineBehaviorEntry[]
Defined in: packages/pipeline/src/options/global-behaviors.options.ts:61
Behaviors appended AFTER the behaviors declared at the call site (still before the actual handler execution). These run closest to the handler, after all other behaviors.
before?
Section titled “before?”
optionalbefore?:PipelineBehaviorEntry[]
Defined in: packages/pipeline/src/options/global-behaviors.options.ts:54
Behaviors prepended BEFORE the behaviors declared at the call site. These run first (outermost) in the pipeline chain.
scope?
Section titled “scope?”
optionalscope?:GlobalBehaviorScope
Defined in: packages/pipeline/src/options/global-behaviors.options.ts:48
Which handler kinds these behaviors apply to.
'commands'— only command handlers'queries'— only query handlers'events'— only event handlers'all'— commands, queries, and events
Default
Section titled “Default”'all'