A live input-viewer for GameCube/N64 controllers over wifi or usb serial. Used for showing/recording inputs during livestreams/gameplay recording sessions.
Instead of declaring ret as an empty object, and then initializing it's properties I would suggest doing the following:
var button = {},
analog = {};
// Code here
return {
button: button,
analog: analog
};
This way you can also shorted up the rest of your code instead of having to use ret.button. or ret.analog.
I've updated my older optimization snippet to include this concept (https://www.irccloud.com/pastebin/zvPElZLJ/).
Instead of declaring
ret
as an empty object, and then initializing it's properties I would suggest doing the following:This way you can also shorted up the rest of your code instead of having to use
ret.button.
orret.analog.
I've updated my older optimization snippet to include this concept (https://www.irccloud.com/pastebin/zvPElZLJ/).