Skip to content

Instantly share code, notes, and snippets.

@alexandercerutti
Last active December 28, 2021 22:54
Show Gist options
  • Save alexandercerutti/602884de5b6a74c060269dce62c49d66 to your computer and use it in GitHub Desktop.
Save alexandercerutti/602884de5b6a74c060269dce62c49d66 to your computer and use it in GitHub Desktop.
Bitwise-article-example
const currentScriptState = getCurrentScriptStateSomehow();
if (currentScriptState === States.LOADING) {
abortCurrentOperationUntilLoaded();
}
if (currentScriptState === States.FAILED) {
skipScriptOperation();
}
if (currentScriptState === States.LOADED || currentScriptState === States.STOPPED || currentScriptState === States.FAILED) {
doSomethingIfScriptIsNotBeingUsed();
}
if (currentScriptState === States.PLAYING) {
startScriptOperation();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment