Hyperlinkv0.8.0-beta.28

Pipeable

Pipeable.Mixinconsteffect/Pipeable.ts:668
<TBase extends new (...args: ReadonlyArray<any>) => any>(
  klass: TBase
): TBase & PipeableConstructor

Returns a subclass of the provided class that adds the standard pipe method.

When to use

Use to add pipe support to an existing class without extending a base class or modifying its prototype.

Details

The original constructor and instance members are preserved, and the added method delegates to pipeArguments.

constructorsPrototypeClass
export const Mixin = <TBase extends new(...args: ReadonlyArray<any>) => any>(
  klass: TBase
): TBase & PipeableConstructor => (class extends klass {
  pipe() {
    return pipeArguments(this, arguments)
  }
})