Skip to content

Instantly share code, notes, and snippets.

@AlbertoDePena
Created April 11, 2018 14:23
Show Gist options
  • Save AlbertoDePena/04a71db622dcfa4b8123db6a692be5f0 to your computer and use it in GitHub Desktop.
Save AlbertoDePena/04a71db622dcfa4b8123db6a692be5f0 to your computer and use it in GitHub Desktop.
import 'toastr/build/toastr.css';
import * as toastr from 'toastr';
toastr.options = {
closeButton: false,
debug: false,
newestOnTop: false,
progressBar: false,
positionClass: 'toast-bottom-full-width',
preventDuplicates: true,
onclick: null,
showDuration: '300',
hideDuration: '1000',
timeOut: '5000',
extendedTimeOut: '1000',
showEasing: 'swing',
hideEasing: 'linear',
showMethod: 'fadeIn',
hideMethod: 'fadeOut'
};
export const notifyError = (message: string): void => toastr.error(message);
export const notifySuccess = (message: string): void => toastr.success(message);
export const notifyWarning = (message: string): void => toastr.warning(message);
export const notifyInfo = (message: string): void => toastr.info(message);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment