Hot answers tagged

5

A few suggestions for general code quality: If your class only does one thing and it doesn't store any values, it should be a function. Redpy only downloads images from reddit and stores values to achieve exactly this, which you could do in a function. Using a class can have unforeseen consequences. Choose descriptive names for variables and functions. ...


2

Nesting promises defeats the purpose of promises as a whole. Promises can be chained together. This is done by returning a promise to then. function postTwit() { return saveImage(content.url, PATH) .then(() => { // Return a promise to a then. The promise returned by then // will not resolve until this promise resolves. return T....


Only top voted, non community-wiki answers of a minimum length are eligible