-
Notifications
You must be signed in to change notification settings - Fork 60
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
feat(composable): add useMedia composable #1370
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
@shopware/api-client
@shopware/api-gen
@shopware-pwa/cms-base
@shopware-pwa/composables-next
@shopware-pwa/helpers-next
@shopware-pwa/nuxt3-module
commit: |
pnpm-lock.yaml
Outdated
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.
pnpm-lock.yaml changes needed? 🤔
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.
the composable we all needed! 🥇
I left some small notes - not crucial but who knows :)
* | ||
* @returns {UseMedia} media composable | ||
*/ | ||
export function useMedia(): UseMedia { |
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.
I would like to see what kind of media this composable is made for. Maybe we could add a parameter in type Media
for composable function, and then we could extract ids from argument and replace/merge it with ids
provided in fetchMedia
function which could then become optional.
the second option to tell something more about the purpose is providing an example in functions' description and changeset file.
import { useShopwareContext } from "#imports"; | ||
import type { operations } from "#shopware"; | ||
|
||
interface UseMedia { |
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.
it's our first interface
within composables, maybe we could keep it consistent and change to the type 😉
Description
Add useMedia composable
Type of change
ToDo's
Screenshots (if applicable)
Additional context