-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 Improve target and fov control flow using new Lock object
- Loading branch information
Showing
3 changed files
with
35 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import A from "https://esm.sh/aladin-lite@3.3.3-beta"; | ||
import A from "https://esm.sh/aladin-lite@3.4.0-beta"; | ||
|
||
export default A; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
export default class Lock { | ||
state = false; | ||
|
||
/** | ||
* Locks the object | ||
* @returns {boolean} True if the object was locked, false otherwise | ||
*/ | ||
unlock() { | ||
if (this.state) { | ||
this.state = false; | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
/** | ||
* Unlocks the object | ||
* @returns {boolean} True if the object was unlocked, false otherwise | ||
*/ | ||
lock() { | ||
if (!this.state) { | ||
this.state = true; | ||
return true; | ||
} | ||
return false; | ||
} | ||
} |