easy-e
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

Coverage Status Build Status npm

easy-e

built in hopes that I will better handle exceptions, it's easy

typescript-library-starter makes it so easy to publish to npm that I'd rather publish out of convenience, its amazing!

now in technicolor!

usage

 
import  Erric  from  'easy-e';
import { toastify } from 'react-toastify'
 
  
 
function  showPopUpWithMessage(msg) {
    // you do work, react-toastify is pretty good if you are using react, example:
    toastify.error(msg);
}
 
  
 
var  blogpost = { name: '#buildingTheWrongThing', medium: 'medium' }
 
  
 
if(!isSluggable(blogpost.name)){
 
validationError = new  Erric();
 
validationError.setCode('validation/blog/name/unsluggable');
 
validationError.setMessageForHumans('sorry, only letters and spaces!');
 
validationError.setMetadata({ input: blogpost.name })
 
validationError.alert(showPopupWithMessage);

a  pretty  red  box pops up says  'sorry, only letters and spaces!

validationError.throw();

/easy-e/

    Package Sidebar

    Install

    npm i easy-e

    Weekly Downloads

    1

    Version

    4.0.0

    License

    MIT

    Unpacked Size

    145 kB

    Total Files

    13

    Last publish

    Collaborators

    • mattjohnston