Skip to content

Instantly share code, notes, and snippets.

@dagda1
Last active April 9, 2021 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dagda1/12996048a837c193ab760b0a1e0dec56 to your computer and use it in GitHub Desktop.
Save dagda1/12996048a837c193ab760b0a1e0dec56 to your computer and use it in GitHub Desktop.
let isActive
if (inactive === false || (active && !inactive)) {
isActive = true
} else if (active === false || (inactive && !active)) {
isActive = false
}
// mutually exclusive string union cures this
// type State = 'ACTIVE' | 'INACTIVE';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment