Skip to content

Instantly share code, notes, and snippets.

@cborodescu
Last active February 15, 2022 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cborodescu/b130da80aa87343fe032206f0a023be1 to your computer and use it in GitHub Desktop.
Save cborodescu/b130da80aa87343fe032206f0a023be1 to your computer and use it in GitHub Desktop.
User Intent Graph - Search App
function SearchListing({ results }) {
const { affinities } = useAffinities();
const categoryAffinity = affinities.find((x) => (x.name = "category"));
const brandAffinity = affinities.find((x) => (x.name = "brand"));
const colorAffinity = affinities.find((x) => (x.name = "color"));
return (
// Display results that match category, brand and color affinities
);
}
function App({ api }) {
const results = api.getResults();
return (
<UserIntentGraphProvider
userIntentGraphClient={userIntentGraphClient}
user={api.getUser()}
>
<SearchListing results={results} />
</UserIntentGraphProvider>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment