createPipeline
Αυτό το περιεχόμενο δεν είναι ακόμη διαθέσιμο στη γλώσσα σου.
createPipeline(
options?):Pipeline
Defined in: packages/pipeline/src/create-pipeline.ts:158
Creates a pipeline: behaviors that wrap plain functions and class methods with cross-cutting concerns, with no framework and no dependency-injection container.
Global behaviors are constructed when the pipeline is created, so a behavior whose required dependency is missing fails here rather than at its first call.
Parameters
Section titled “Parameters”options?
Section titled “options?”PipelineOptions = {}
Returns
Section titled “Returns”Throws
Section titled “Throws”TypeError on a malformed global entry or two instances of one behavior class.
Example
Section titled “Example”const pipeline = createPipeline({ behaviors: [new CacheBehavior(buildCache({}))], globalBehaviors: { before: [logging({ requestResponseLogLevel: 'log' })] },});
export const getPrice = pipeline.wrap( { name: 'getPrice', kind: 'query' }, cache({ key }),)(async (sku: string) => prices.find(sku));
class Prices { @pipeline.wrap({ kind: 'query' }, cache({ key })) async find(sku: string) {}}