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

Destructure aspects of useQuizCreation composable within components #11546

Closed
5 tasks done
marcellamaki opened this issue Nov 20, 2023 · 1 comment
Closed
5 tasks done
Assignees
Labels
P1 - important Priority: High impact on UX

Comments

@marcellamaki
Copy link
Member

marcellamaki commented Nov 20, 2023

Observed behavior

Currently state is provided/injected via a named object quizForge. To simplify the code, be consistent in use of the composition API, and improve how the module's exports work with tooling, we should instead use the composition API's provide/inject functionality. See useSeach for a similar use case represented.

Acceptance Criteria

  • Remove all references to quizForge
  • All values that are returned in the exported function in useQuizCreation.js should be provided in addition to being returned. This should result in our being able to instantiate a single shared instance of the module by way of...
  • A function similar to the useSearch.js#injectSearch() (eg, injectQuizCreation) function can be used to inject the provided values wherever we would like. It should just create the injected objects and return them.
  • All instances where quizForge was injected should now have injectQuizCreation called and all used properties of it destructured from the call to your new function.
    For example, if you only use the updateSection method you'd say: const { updateSection } = injectQuizCreation() -- and then return that updateSection variable from within setup().
  • Tests should pass largely as-is for the useQuizCreation, although some changes might be required to accommodate the updates with injection
@nucleogenesis
Copy link
Member

This is closed by #11562

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 - important Priority: High impact on UX
Projects
None yet
Development

No branches or pull requests

3 participants