Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@pipeletteio/nop

pipeletteio3.3kMIT1.0.5TypeScript support: included

A simple nop function helper

readme

@pipeletteio/nop

A simple nop (no-op) function helper. Nop is a function that does nothing.

Installation

npm install @pipeletteio/nop

Example

import { nop, isNop } from '@pipeletteio/nop';
// const { nop, isNop } = require('@pipeletteio/nop');

isNop(nop); // => true

isNop(function () {}); // => false

Docs

Read documentation for more informations.

API

nop

The nop function which will be used to replace the non cancellable callables.

argument type details
...arg any[] ...

Return void.

isNop

Check if the argument is the nop function.

argument type details
arg any The checked argument.

Return a boolean.

changelog

0.1.0

16/04/2020

  • Add nop function to replace non-cancelable calls.
  • Add isNop function to check if an argument is the nop function.