question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Code cleanup: use classes

See original GitHub issue

I think it would be much better if we move away from loose functions and use classes for Skin, Avatar, Render, Cape, Profile, etc. This would make things a lot easier.

for example:

var skin   = new Skin(uuid);
var avatar = new Avatar(skin, true);

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jengel3commented, May 26, 2016

@RobertHerhold Having any discussion here would be best. Future contributors can reference it and anyone that has ideas/concerns can chime in here.

0reactions
jomocommented, May 26, 2016
if (err || (is_uuid && !profile)) {
  // error or uuid without profile
  if (!err && !profile) {
    // no error, but uuid without profile

As commented below the line, it’s possible to have a UUID but not have a profile, which means the user does not exist. The comment doesn’t really indicate that, sorry. It was introduced in 3fdd942c0f1c507b86bb530adf051c9dac64aeef as a fix for #93.

PS: When you link to source code on GitHub, press Y to get a permalink.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript code cleanup: how you can refactor to use Classes
Here, I'll show you how to use a Class (instead of exporting individual functions and variables) to organize your code.
Read more >
Code style options and code cleanup - Visual Studio (Windows)
First, configure which code styles you want to apply (in one of two profiles) in the Configure Code Cleanup dialog box. To open...
Read more >
Code cleanup | ReSharper Documentation - JetBrains
Right-click the selection and choose Cleanup Code in the context menu. Choose a cleanup profile as described above. Click Run to clean up...
Read more >
JavaScript Clean Code — Objects and Classes
In this article, we'll look at how to organize our data in a way that's easy for us to use. Use Classes Over...
Read more >
How to use cleanup code in Visual Studio - Developers Log
Running Code Cleanup with any of the available profiles will automatically apply to the file we are working on, the fixes we have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found