Created
          July 1, 2022 01:32 
        
      - 
      
 - 
        
Save szaranger/296ba18d1bb30423c25bb3785a9ec5f4 to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | let initialState; | |
| class User { | |
| #isActive = false; | |
| get getState(){ | |
| if(!this.#isActive){ | |
| throw new Error('User is not active'); | |
| } | |
| return this.#isActive; | |
| } | |
| static { | |
| initialState = () => { | |
| this.#isActive = this.getState; | |
| } | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment