Download src/io/userData.js from soiz1/s4s-vm: direct link, hf CLI and curl.
- Browser
- Download file 880 Bytes
-
https://huggingface.co/datasets/soiz1/s4s-vm/resolve/main/src/io/userData.js
- Command line
-
hf download hf://datasets/soiz1/s4s-vm/src/io/userData.js
-
curl -L -o userData.js https://huggingface.co/datasets/soiz1/s4s-vm/resolve/main/src/io/userData.js
880 Bytes
| class UserData { | |
| constructor () { | |
| this._username = ''; | |
| this._loggedIn = false; | |
| } | |
| /** | |
| * Handler for updating the username | |
| * @param {object} data Data posted to this ioDevice. | |
| * @property {!string} username The new username. | |
| */ | |
| postData (data) { | |
| this._username = data.username; | |
| this._loggedIn = false; | |
| if (data.loggedIn === true) { | |
| this._loggedIn = true; | |
| } | |
| } | |
| /** | |
| * Getter for username. Initially empty string, until set via postData. | |
| * @returns {!string} The current username | |
| */ | |
| getUsername () { | |
| return this._username; | |
| } | |
| /** | |
| * Getter for loggedIn. Will be false, until set via postData. | |
| * @returns {boolean} The current loggedIn state | |
| */ | |
| getLoggedIn() { | |
| return this._loggedIn; | |
| } | |
| } | |
| module.exports = UserData; | |