javascript
20 03 2020
Maks Nemisj | javascript |
Have you ever been into a situation where you wanted to do something with your state inside useEffect hook but didn’t want to put it into a dependency array? react-hooks/exhaustive-deps is an excellent guard when working with primitive values, but as soon as you have an object in the state, it might stay on your […]
hooks, javascript, react.js, reactjs
31 01 2019
Maks Nemisj | javascript |
If you’re already using async/await syntax, you might notice that forEach is not working for asynced functions. In that case you might start doing old style for loops or even for-of loops. Also if you have a bluebird package already installed you can use bluebird.each() instead. In ECMAScript 2018 there is going to be asynchronous […]
async, each, javascript, promise
12 12 2016
Maks Nemisj | javascript |
Recently I’ve came across a couple of node.js projects which use NODE_ENV for defining environment for the Development, Testing, Acceptance and Production (DTAP) pipeline. At first sight this looks like a good idea, but I would advise against it. What we often see is that npm modules are consuming NODE_ENV as either ‘production’ or something […]
best-practice, javascript, node.js, nodejs
24 11 2016
Maks Nemisj | javascript |
Today JSON is widely used in different corners of software development. It’s used as data format, as configuration or even as in memory database. At my current company we also use it as configuration format. The more I use it, the more I have feeling that it’s “a bit” inconsistent and “raw”. You would expect […]
configuration, javascript, json, parse
6 09 2016
Maks Nemisj | javascript |
Do you know what would be the result of the following code executed in node.js without babel and any transpiling? example.js Do you know the result ? Think good … And one more time Well, it appears that it depends on the version of the node.js ( and guess […]
execution, javascript, node.js
27 06 2016
Maks Nemisj | javascript |
When preparing application for deploying to production env I want to ensure that everything is properly logged, especially things which are unexpected in code. That’s why, I think, proper error handling is crucial to any application. This is a short article on how to do an error handling when going live in isomporhic web app […]
error, express.js, expressjs, fluxible, isomorphic, javascript, node.js, nodejs, react.js, reactjs
28 04 2016
Maks Nemisj | javascript |
If you’ve decided to move react components to es6/es2015 syntax you’ve might found out that defining propTypes and contextTypes is not that seamless as it was. Babel@6.7.7 doesn’t yes support static properties on Classes and the most evident way to use propTypes is to append them to the class at the end: Though there is […]
es2015, es6, javascript, react.js, reactjs
6 10 2015
Maks Nemisj | javascript |
UPDATE (15 May 2020) : I see a lot of comments regarding TypeScript and that there is no issue with setters/getters while using static typing. Of course, you can safely use getters/setters in the environment, which guarantees static type check, but this article is about vanilla JavaScript. This article is my opinion why I think this […]
classes, getters, javascript, setters
24 07 2015
Maks Nemisj | javascript |
Have you ever needed to repeat a string or character multiple times? Some times I have this need ( don’t ask why ) and it was always annoying for me to do this. For such a simple operation, you have to write for loop and concatenate string. I know, there is now repeat available in […]
bit shifting, experiment, javascript
17 06 2015
Maks Nemisj | javascript |
Embellishment of a story Recently I had to setup a new mini webserver. The functionality of this server was not very complex: 1. Fetch JSON data from [Jenkins](http://jenkins-cli.com) server 2. Transform JSON into another format 3. Read files from the file system 4. Return the result to the user I took express.js and node-jenkins package […]
async, callbacks, es2015, generators, javascript, node.js