Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

feat(InfiniteHits): support cache #804

Merged
merged 3 commits into from
Jun 19, 2020
Merged

Conversation

eunjae-lee
Copy link
Contributor

@eunjae-lee eunjae-lee commented Jun 16, 2020

This PR adds support for cache.
related to: algolia/instantsearch#4431

It basically accepts a new prop cache and pass it to the connector.
I've added a story to test sessionStorage cache in action.

@@ -1,5 +1,6 @@
import { storiesOf } from '@storybook/vue';
import { action } from '@storybook/addon-actions';
import { createInfiniteHitsSessionStorageCache } from 'instantsearch.js/es/lib/infiniteHitsCache';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we reexport createInfiniteHitsSessionStorageCache from vue-instantsearch?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an interesting idea, but we don't do that for now for other things like router, I'm not sure if that can have a bundle size impact?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it'll have a bundle size impact but it's worth trying.

On a UX perspective, it doesn't make sense to import something from a library's dependency (you're not even aware that you use instantsearch.js when you use vue-instantsearch).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's do it in a stacked PR? There's argument for exposing the connectors etc. too, so let's join that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess not in a stacked PR but a separate PR as in something like chore: reexport things from IS.js...

If we're going to reexport stuff, then we'd better do them altogether with doc changes.
What do you think?

src/components/InfiniteHits.vue Show resolved Hide resolved
@eunjae-lee eunjae-lee requested a review from Haroenv June 19, 2020 08:24
@eunjae-lee eunjae-lee merged commit 918c92d into master Jun 19, 2020
@eunjae-lee eunjae-lee deleted the feat/infinite-hits-cache branch June 19, 2020 09:52
Haroenv pushed a commit to algolia/instantsearch that referenced this pull request Dec 28, 2022
* feat(InfiniteHits): support cache

* test: add test accepting a cache prop
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants