itemsapi / itemsjs

Extremely fast faceted search engine in JavaScript - lightweight, flexible, and simple to use
Apache License 2.0
346 stars 41 forks source link

json from fetch api is not working #58

Closed Kugeleis closed 3 years ago

Kugeleis commented 3 years ago

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

cigolpl commented 3 years ago

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));