-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add useAnswersUtilities #46
Conversation
src/useAnswersUtilities.ts
Outdated
export type AnswersUtilities = AnswersHeadless['utilities']; | ||
|
||
export function useAnswersUtilities(): AnswersUtilities { | ||
return useContext(AnswersActionsContext).utilities; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we need to rename AnswersActionsContext
now that it supplies both actions and utilities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'm thinking AnswersContext
or AnswersHeadlessContext
Add a useAnswersUtilites hook which provides the utility methods from AnswersHeadless
Because
AnswersActionsContext
no longer supplies just actions, it is renamed toAnswersHeadlessContext
.AnswersActionsContext
is also renamed toAnswersHeadlessProvider
J=SLAP-1649
TEST=manual
Update the Facets component to use the utility hook and manually test in the sample app