Provides a few global functions such as noop
, throwop
, and doop
npm install noop@v1
require("noop");
- Works with Promises and Thunks
- Faster than
Object
(alwaystrue
-y) - More predictable than
Boolean
(sometimesfalse
-y) - Linted with TypeScript, JSHint, and Prettier
Does nothing
function noop() {}
Throws if err
is true
-y
function throwop(err) {
if (err) {
throw err;
}
}
Calls callback
or noop
function doop(callback, args, context) {
if ("function" === typeof callback) {
callback.apply(context, args);
}
}
Similar function signature to setTimeout
.
MIT OR CC0-1.0 (Public Domain)
Written in 2011 by AJ ONeal coolaj86@gmail.com
To the extent possible under law, the author(s) have dedicated all copyright
and related and neighboring rights to this software to the public domain
worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with
this software. If not, see https://creativecommons.org/publicdomain/zero/1.0/.