Skip to content

4 Promises and code practice suggestions

Rnjai Lamba edited this page Apr 6, 2016 · 8 revisions

bluebird vs q
https://github.com/petkaantonov/bluebird/issues/381
http://ricostacruz.com/cheatsheets/bluebird.html
http://raymondjulin.com/2014/05/10/writing-solid-asynchronous-code-using-promises/
http://alexperry.io/node/2015/03/25/promises-in-node.html
http://javascriptplayground.com/blog/2015/02/promises/

Coding Practices
http://www.callumhart.com/blog/non-blocking-uis-with-interface-previews - non blocking ui
http://javascriptplayground.com/blog/2015/02/promises/ - promises
Javascript callback function data. - http://stackoverflow.com/questions/4492932/how-do-i-set-a-callback-function-parameter-like-data-in-the-jquery-ajax-suc
include js in other - http://stackoverflow.com/questions/4634644/how-to-include-js-file-in-another-js-file

Event loop
https://strongloop.com/strongblog/node-js-event-loop/
http://stackoverflow.com/questions/25568613/node-js-event-loop

Asynchronous and promises and callback
http://codetunnel.com/what-are-callbacks-and-promises/#promises makes sense now
Read below in order to understand promises
http://www.html5rocks.com/en/tutorials/es6/promises/#disqus_thread - much more best
http://www.html5rocks.com/en/tutorials/async/deferred/ best
http://javascriptplayground.com/blog/2015/02/promises/ read in order
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise - brilliant examples
https://blog.domenic.me/youre-missing-the-point-of-promises/ - super brilliant examples
http://ricostacruz.com/cheatsheets/bluebird.html - cheat sheet
http://alexperry.io/node/2015/03/25/promises-in-node.html - nice bluebird examples
http://stackoverflow.com/questions/22519784/how-do-i-convert-an-existing-callback-api-to-promises - callback to promises
http://stackoverflow.com/a/19756960/815929 callbacks
http://blogs.msdn.com/b/rbuckton/archive/2010/01/29/promises-and-futures-in-javascript.aspx - make big promise small
https://spion.github.io/posts/why-i-am-switching-to-promises.html - ok

var url = s3.getSignedUrl(‘putObject’, params);

s3.getSignedUrl(‘putObject’, params, function (err, url){
 console.log(url,”this is the pre-signed URL”); // this is the pre-signed URL
});

Best Practices
https://github.com/mattdesl/module-best-practices
http://www.innofied.com/node-js-best-practices/
https://devcenter.heroku.com/articles/node-best-practices#stick-with-lowercase
https://github.com/airbnb/javascript#objects
https://github.com/RisingStack/node-style-guide#variables
https://blog.risingstack.com/node-js-best-practices/


Promises Final resource
http://alexperry.io/node/2015/03/25/promises-in-node.html
http://ricostacruz.com/cheatsheets/bluebird.html
http://stackoverflow.com/questions/21298190/bluebird-promises-and-then

https://github.com/rnjailamba/website/commit/83a39952e8674a106f8d48ecbd5f2db4e49508dc?diff=unified
https://github.com/rnjailamba/website/commit/ecb5eed4206adf692a7c3bce09824a864fb25304

Advice
http://highscalability.com/blog/2016/1/11/a-beginners-guide-to-scaling-to-11-million-users-on-amazons.html