๐ฆ Supreme nothingness
$ npm install --save noop3
const noop = require('noop3');
function unicorn(fn) {
fn = fn || noop;
return fn('unicorn');
}
unicorn();
// also compatible with non-mythical single horned creatures
function narwhal(fn) {
fn = fn || noop;
return fn('narwhal');
}
narwhal();
// Using the noop factory
const fn = require('noop3/factory');
const rainbow = fn();
const flowers = fn();
rainbow === flowers
//=> false
rainbow()
//=> undefined
MIT ยฉ Sindre Sorhus