import { merge , OperatorFunction } from 'rxjs' ; import { Emission } from '../shared/emission' ; import { Pin } from './pin' ; import { PinLike } from './pin-like' ; export type PipeFunc = OperatorFunction < Emission , Emission > ; /**
 *
 * Represents [pipe](https://connective.dev/docs/pipe) pins.
 *
 */ export class Pipe extends Pin { /**
     *
     * The list of pipe functions that constitute this pipe.
     *
     */ readonly pipes : PipeFunc [ ] ; constructor ( pipes ) { super ( ) ; this . pipes = pipes ; } param inbound protected resolve ( inbound ) { return this . pipes . reduce ( ( observable , pipe ) => observable . pipe ( pipe ) , ( inbound . length == 1 ) ? inbound [ 0 ] . observable : merge ( ... inbound . map ( pin => pin . observable ) ) ) ; } } param pipes export function pipe ( ... pipes ) { return new Pipe ( pipes ) ; } export default pipe ;