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 07 2017
Maks Nemisj | javascript |
Recently I’ve got a pleasure to debug some bug inside node.js app. Run-time was breaking with the following error: Quite usual error, meaning that object has no forEach function. Let’s see the code itself: I bet you were surprised like I was. This is just not possible from the first look, right?. If you read […]
execution, getters, quiz, setters
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
23 11 2016
Maks Nemisj | javascript |
It’s going to be a short one, but powerful. Do you remember I wrote previously why getters/setters is a bad idea in JavaScript? I didn’t change my mind, I do still think so, but now I found one valid place where I can and DO want use them. You will never guess. (just kidding) Unit […]
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
26 04 2016
Maks Nemisj | javascript |
If you have moved to Ubuntu 16.04 you can find out that your old ViM stuff is not working – Some plugins are broken. This is due to the change in python interpreter for ViM ( https://wiki.ubuntu.com/XenialXerus/ReleaseNotes#VIM_defaults_to_python3 ) To fix this you have to use different package of vim, like vim-gnome-py2. If you’re like me […]
plugins, vim, vimscript