npm.io
0.0.3 • Published 9 years ago

sketch-module-invariant

Licence
MIT
Version
0.0.3
Deps
0
Vulns
0
Weekly
0

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