React-instantsearch: Can you pre filter connectInfiniteHits with transformItems ? Or remove hits somehow?

Created on 7 Jun 2018  路  2Comments  路  Source: algolia/react-instantsearch

HI,

I would like to be able to remove a list of hits from the results received by connectInfiniteHits, I don't see that transformItems is allowed as a prop. Is there a way to do this?

My use case is that I'm giving a user the ability to add items to their order, but I don't want them to be able to add duplicates of items already in their order so I need to remove whatever is in their order from the hits results.

thanks!

Most helpful comment

Hey @rtman, for that it'll be best to use connectInfiniteHits and use hits.filter(isDuplicateOfUserProvided). Does that make sense?

All 2 comments

Hey @rtman, for that it'll be best to use connectInfiniteHits and use hits.filter(isDuplicateOfUserProvided). Does that make sense?

@Haroenv Yup totally, I was actually thinking of doing something like that but I wondered if there was a built in way with react-instantsearch. This works good tho!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aaronbushnell picture aaronbushnell  路  4Comments

oznekenzo picture oznekenzo  路  3Comments

noclat picture noclat  路  3Comments

flouc001 picture flouc001  路  5Comments

developerk786 picture developerk786  路  3Comments