MAP JSON Generator – Preview (built in React)

As web developer I daily work with the JSON format and I often need to mock data.
There are a lot of nice JSON generators (I love JSON Generator) but I have not found something useful in order to generate a list of real coordinates.

So I have created my own MAP JSON Generator to cover all my needs (using React and Google Map Javascript API):

Start reading the Map JSON generator Documentation.

(more…)

Read More

EaselJS: custom Display Objects in ES2015

snippet

I love HTML5 Canvas, because I’m free to draw anything I have in my mind without the limit of the DOM, and EaselJS is a great library that simplify the traditional Javascript canvas syntax.
EaselJS is based on the concept of the display list ( very similar to ActionScript ) and if you have used it for a while you probably created a custom Display Object by using the official inheritance technique.

Since ES2015 (aka ES6) is still not officially supported by the library (currently 8.x), in this post I’m basically sharing my way to create custom display objects in ES6.

Suggestions are welcome.

(more…)

Read More

Create controlled async sequences

Today I’ve been asked on how approach the creation of a sequence of async calls and retain control over any possible point of failure.
There are several possible solutions to this scenario, using es2016’s async functions or es2015’s generator functions would make the solution simpler and easier to be read but I’ve been asked to use only valid es5 code.

The goals of this particular exercise are:

  • accept sequences of variable length
  • create a reusable solution
  • have knowledge and control over thrown exceptions

The basic idea is to create an array of async actions and execute it step by step. To support this we need an object able to iterate over our array of actions.

(more…)

Read More