Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. export class Loader {
  2.     constructor(
  3.         descripcion: string,
  4.         tipo?: string,
  5.         isLoading: boolean
  6.     ) {
  7.         this.isLoading = false;
  8.     }
  9.  
  10.     on() {
  11.         this.isLoading = true;
  12.         this.clone();
  13.     }
  14.  
  15.     off() {
  16.         this.isLoading = false;
  17.         this.clone();
  18.     }
  19.  
  20.     clone() {
  21.         this = Object.assign({}, this);
  22.     }
  23. }
  24.  
  25.  
  26.  
  27. /**** Ej ****/
  28.  
  29. // para inicializar
  30. controlsLoading = {
  31.     holdings: new Loader('holdings)
  32. }
  33.  
  34. // cuando termine de cargar
  35. this.controlsLoading.off();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement