Hey, Listen! provides simple versions of the popular warning
and invariant
dev-experience functions.
The library checks against process.env.NODE_ENV
to minify away messages in production.
npm install hey-listen
yarn add hey-listen
import { warning } from 'hey-listen';
warning(false, 'Warning message'); // console.warn "Warning message"
import { invariant } from 'hey-listen';
invariant(false, 'Error message'); // throws "Error message"