-
Implementing an async queue in 23 lines of code
posted in JavaScript on 2018-05-07 tasks taskindex getnexttask numofworkers function result promise task array process error run -
Recently we had an interesting task at work. The user makes a selection of items and clicks a button. Then for every selected item we have to make a request to our API. The thing is that the user may click as many items as he/she wants. In order to speed up the process we decided to handle four requests in parallel and once some of them is finished we pull the next one. If you ask why exactly four requests in parallel read this paper.
read more
-
How require/import may decrease your testability
posted in JavaScript on 2015-08-23 login http js function var module password username login js user promise -
When CommonJS was announced we all thought “Finally something that will organize our code”. However, there are some cons that we should be aware of. It’s not only unicorns and rainbows. In this article we will see how a simple
read morerequire
line makes our code difficult to test.