Things recently touched

Things recently touched

Been busy and lazy
Did some fix for a small project, worked on React, Redux, ImmutableJs & Saga.

One thing to note down: JSON doesn’t preserve order.
I had a task to fix the display of a list to make them display in alphabet order.
At the very begining, I just added a ORDER BY in the back-end query, thougt it would be ok, but no, the display is still random. After some digging and googling, found out it is the JSON.
Even though the data fetched from DB is sorted, it then get parsed as JSON and sent to front-end.
Work around is to store the data in Array and then JSON will have it in right order.
Example:

1
2
3
4
5
6
7
8
9
10
// array in JSON
{
"arrayItem":
[
{"1":"a"},
{"2":"b"},
{"3":"c"},
{"4":"d"}
]
}

Reference: StackOverFlow Related Question

Started a project involving GraphQL, seems interesting.
The GraphQL->DB layer and query builder is mostly done by other developer. I will work on building the front-end interface that can build and to shot GraphQL query.