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

1.0.1 • Public • Published

rtap

An implementation of Rubys #tap for TypeScript

Usage

Use on any object:

import { tap } from "rtap";

const user: User = tap(new User(), (u: User) => {
  u.name = "Foo";
});

Added as a mixin to a class:

import { tappify } from "rtap";

const User = tappify(BaseUser);

const user = new User().tap((u: User) => {
  u.name = "Foo";
})

Readme

Keywords

none

Package Sidebar

Install

npm i rtap

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

4.46 kB

Total Files

18

Last publish

Collaborators

  • sam.boylett