tap-decorator
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

tap-decorator

tap-decorator is a TypeScript library that enables you to use a Tap decorator to observe any function without interfering. It is perfect for debugging, testing, and logging your code with ease.

usage

import { Tap } from "tap-decorator";

class Foo {
  @Tap((ob) =>
    ob.subscribe(({ seq, result }) => {
      console.log("seq", seq);

      result.subscribe((x) => {
        console.log("result", x);
      });
    })
  )
  public foo() {
    return 1;
  }
}

const foo = new Foo();
foo.foo();
foo.foo();

Package Sidebar

Install

npm i tap-decorator

Weekly Downloads

0

Version

1.0.0

License

BSD-3-Clause

Unpacked Size

7.1 kB

Total Files

7

Last publish

Collaborators

  • i-play-lf2