February 25, 2017

Using JSON parse and stringify to clone objects

Immutability is important. The stackoverflow article that I just linked would explain why immutability is important. I am accustomed to using Immutable.js at work, but when I came across an ancient project that didn’t make sense to add a new library just for using immutable objects, I had to resort to Object.assign. But the problem with Object.assign though is that you cannot use it to modify deep properties. Take this for example: Read more

February 18, 2017

Using datasets to avoid inline arrow functions

Adding an inline anonymous/arrow function in React is not recommended due to the nature of how react behaves. The render method would always be called each time a state or property is updated, which would then create a new function if we are using inline arrow functions, and then this would force the GC (garbage collector) to clean the previous arrow function. render() { // Not good :\ return <div onClick={e => console. Read more

January 1, 2017

A New Start

I decided to restart my blog yet again, and this time I’m planning to just document my thoughts at least every month. I’m looking forward to getting this goal done, specially with the fact that I’m getting married in 2~3 weeks time!… Which means that I might actually have more things to write about :D A lot has happened since last year. I clocked a lot of extra hours of work, for the preparation of my wedding. Read more

© Daniel Cefram 2017