Posts tagged 'javascript'
Tag: javascript
How to do proper exceptions handling
An exception happens when something we expected that should happen, didn’t. We can log them, but printing logs everywhere add a lot of noise, so it’s better to throw errors and handle them in upper levels. Also, a thrown error is easy to check and test, but a log message is not, so they are better for unit testing.
Abstract classes in Javascript Signature Post
Javascript don’t have the concept of abstract classes, but it’s fairly easy to
implement: don’t allow to instanciate them :-) Just check if the constructor
of the instance we are creating is the own class instead of one of its
childrens, and don’t throw an error if it is:
How to move Javascript functions out of its closure to save memory
Long time ago I talked about a pattern I use (a lot!) abusing the functional methods of Javascript to earn some memory and CPU usage. I promised to create a blog post, and almost 4 months after (too much energy draining work…), here is it.
What's `re-start`?
React Native is a framework derived from React that allow to program mobile native apps using Javascript. It’s only focused on Android and iOS, but its popularity has lead to other implementations of its API for other platforms like Windows, macOS or also web. Thing is, although they share the same APIs and source code is (almost) compatible between them, they are not integrated so it would surface difficulties to add a new platform to an existing code, or forcing to have several different projects that could lead to duplicated efforts or diverge the features of them.
redux-offline in Node.js
Experimenting with
redux-offline, I’ve done a
Proof-of-Concept about how to use
redux-offline in a Node.js environment,
like a CLI command. This is useful for example when it’s needed to do an offline
aware application that needs to queue some operations until it’s connected
again.