Skip to content
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

Merged
merged 9 commits into from
Oct 25, 2021
Merged

Add useAnswersUtilities #46

merged 9 commits into from
Oct 25, 2021

Conversation

cea2aj
Copy link
Member

@cea2aj cea2aj commented Oct 22, 2021

Add a useAnswersUtilites hook which provides the utility methods from AnswersHeadless

Because AnswersActionsContext no longer supplies just actions, it is renamed to AnswersHeadlessContext. AnswersActionsContext is also renamed to AnswersHeadlessProvider

J=SLAP-1649
TEST=manual

Update the Facets component to use the utility hook and manually test in the sample app

export type AnswersUtilities = AnswersHeadless['utilities'];

export function useAnswersUtilities(): AnswersUtilities {
return useContext(AnswersActionsContext).utilities;
Copy link
Contributor

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.

Copy link
Member Author

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

Base automatically changed from dev/headless-rename to main October 25, 2021 19:01
@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 75.269% when pulling 7d305f9 on dev/useAnswersUtilities into 74c10a5 on main.

@cea2aj cea2aj merged commit 7c35321 into main Oct 25, 2021
@cea2aj cea2aj deleted the dev/useAnswersUtilities branch October 25, 2021 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants