0.0.3 • Published 7 years ago
sketch-module-invariant v0.0.3
Sketch Module Invariant
A sketch module to handle truthys; similar to Facebook's invariant.
Usage
import invariant from 'sketch-module-invariant'
// No errors
invariant(someTruthyVal, { message: 'This will not throw'})
// This will throw an error with this message
invariant(someFalseyVal, { title: 'This will throw an error with this message.', message: 'Nothing to sync!', button: 'Okay' })
Options
Options = { } | Type | Description |
---|---|---|
title | string | The title of the alert. |
message | string | The message of the alert. |
button | string | The button label of the alert. |
Installation
npm
npm --save-dev sketch-module-invariant
yarn
yarn add --dev sketch-module-invariant