Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save szaranger/296ba18d1bb30423c25bb3785a9ec5f4 to your computer and use it in GitHub Desktop.
Save szaranger/296ba18d1bb30423c25bb3785a9ec5f4 to your computer and use it in GitHub Desktop.
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