import { ToastrService } from 'ngx-toastr'; import { each } from 'lodash'; // Seams Load Success & Fail export function handleLoadFail(toastr: ToastrService, errors: string[]): void { each(errors, (e: string) => toastr.error(e, '')); } export function handleSuccess(toastr: ToastrService, message: string | string[] = 'Saved Successfully.'): void { toastr.clear(); if ( typeof message === 'string') { toastr.success( message ); } else { each(message, (e: string) => toastr.success(e, '')); } }