Advertisement
Guest User

notifications functions

a guest
Apr 4th, 2020
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export default (function notifications() {
  2.     function handleError(reason) {
  3.         showError(reason.message);
  4.     }
  5.  
  6.     function showInfo(message) {
  7.         let successBox = $('#successBox');
  8.         successBox.text(message);
  9.         successBox.show();
  10.         setTimeout(() => successBox.fadeOut(), 3000);
  11.     }
  12.  
  13.     function showError(message) {
  14.         let errorBox = $('#errorBox');
  15.         errorBox.text(message);
  16.         errorBox.show();
  17.         setTimeout(() => errorBox.fadeOut(), 3000);
  18.     }
  19.  
  20.     return {
  21.         handleError,
  22.         showInfo,
  23.         showError
  24.     };
  25.  
  26. })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement