itemsapi / itemsjs

Extremely fast faceted search engine in JavaScript - lightweight, flexible, and simple to use

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

json from fetch api is not working

Kugeleis opened this issue · comments

While the example uses a js file with a variable in it I try to fetch data and return it a json. itemsjs does not recognize the array. Providing the identical data as js like in the example works fine.
fetch-vs-var

It is more a problem of how you handle data after making request and not ItemsJS itself.

Let's try to stringify and parse an array and it's gonna work:

var data = JSON.parse(JSON.stringify(obj));