Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/revoltio/deps.ts>Collection#tap

No-nonsense Revolt library for nodejs and deno.
Latest
method Collection.prototype.tap
import { Collection } from "https://deno.land/x/revoltio@v1.0.0/deps.ts";

Runs a function on the collection and returns the collection.

Examples

collection .tap(coll => console.log(coll.size)) .filter(user => user.bot) .tap(coll => console.log(coll.size))

Parameters

fn: (collection: this) => void

Function to execute

Parameters

fn: (this: T, collection: this) => void
thisArg: T