A sketch module to handle truthys; similar to Facebook's invariant.
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 = { } | Type | Description |
---|---|---|
title | string |
The title of the alert. |
message | string |
The message of the alert. |
button | string |
The button label of the alert. |
npm --save-dev sketch-module-invariant
yarn add --dev sketch-module-invariant