mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-25 07:22:33 -05:00
24 lines
539 B
JavaScript
24 lines
539 B
JavaScript
class UserData {
|
|
constructor () {
|
|
this._username = '';
|
|
}
|
|
|
|
/**
|
|
* 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;
|
|
}
|
|
|
|
/**
|
|
* Getter for username. Initially empty string, until set via postData.
|
|
* @returns {!string} The current username
|
|
*/
|
|
getUsername () {
|
|
return this._username;
|
|
}
|
|
}
|
|
|
|
module.exports = UserData;
|