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

update items list - in what lifecycle hook to put itemsjs() #60

Closed Kugeleis closed 2 years ago

Kugeleis commented 3 years ago

I use this tool in a Vue SPA where the user can add items. Up to now I run itemsjs() as a static procedure before page creation. what would be the correct lifecycle hook to put itemsjs() to reevaluate the items list after the user adds an item?

cigolpl commented 3 years ago

You need to simply reindex data with method: itemsjs.reindex(data)

Unfortunately there are no .add, .update, .delete functions right now