cheetah-grid
cheetah-grid copied to clipboard
Using CSV data instead of JSON
It seems like parsing to JSON is sort of a costly unnecessary step for data that is already in CSV format - do you have any way to accommodate for that style of data? Where the fields for the columns would be laid out like:
let fields = ["id", "name", "screen_name", "location", "description", "url", "protected", "followers_count", "friends_count", "listed_count", "created_at", "favourites_count","verified", "statuses_count", "profile_background_image_url_https", "profile_image_url_https" ]
And the values would come in arrays from streaming chunks of CSV. Right now I convert them but it seems like there must be a better way :)
Does that mean the records are in an array? If so, field can be a function that gets the value from the record. You may be able to use this.
{
// ...
field: record => record[0], // id
// ...
},
{
// ...
field: record => record[1], // name
// ...
}