Home > @idealeap/pipeline > Pipe > fromJSON
Pipe.fromJSON() method
Creates a new Pipe instance from a serializable options object.
Signature:
typescript
static fromJSON<T, R>(json: SerializablePipeOptions, callback: (input: T, context: PipelineContext) => MaybePromise<R>, predefinedUses?: PipeRegistryType): Pipe<T, R>;static fromJSON<T, R>(json: SerializablePipeOptions, callback: (input: T, context: PipelineContext) => MaybePromise<R>, predefinedUses?: PipeRegistryType): Pipe<T, R>;Parameters
| Parameter | Type | Description |
|---|---|---|
| json | SerializablePipeOptions | The serializable pipe options. |
| callback | (input: T, context: PipelineContext) => MaybePromise<R> | The processing function. |
| predefinedUses | PipeRegistryType | (Optional) An optional registry of predefined functions. |
Returns:
Pipe<T, R>
A new instance of the Pipe.