Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Implemented
-
None
-
None
Description
In Client.js you have what is essentially an enum of state values (https://github.com/apache/guacamole-client/blob/a54c78554f855bb5a0f49011a8f6e576a6bde164/guacamole-common-js/src/main/webapp/modules/Client.js#L35-L40) and these are exposed to the user via the onstatechange callback, however the enum names are not exposed to the user, being function-scoped variables. Having access to these states by name would allow the user to write more self-documenting code and insulate from changes in the underlying state values. This practice is common in compiled languages.
Indeed you do so correctly in Tunnel.js where you have a very similar construct that IS properly exposed to the user (https://github.com/apache/guacamole-client/blob/a54c78554f855bb5a0f49011a8f6e576a6bde164/guacamole-common-js/src/main/webapp/modules/Tunnel.js#L190-L224).
Could the state values in Client.js please be similarly exposed?