-
Notifications
You must be signed in to change notification settings - Fork 63
Conversation
Storybook and Tailwind configuration previews: Ready Storybook: https://wordpress.github.io/openverse-frontend/_preview/1590 Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again. You can check the GitHub pages deployment action list to see the current status of the deployments. |
Size Change: -76.3 kB (-5%) ✅ Total Size: 1.33 MB
ℹ️ View Unchanged
|
...props, | ||
} as unknown as typeof window) | ||
|
||
const UseWindowScrollTestContainer = Vue.component( |
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.
Very interesting setup!
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 think it might be possible to create a "generic" component for this to test composables, but I'm not sure 😅
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.
Works great!
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.
Looks good to me, though I do have a non-blocking question.
@@ -52,5 +58,5 @@ export function useWindowScroll({ | |||
passive: true, | |||
}) | |||
|
|||
return { x, y, isScrolled } | |||
return Object.freeze({ x, y, isScrolled }) |
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 don't understand why this object is frozen.
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.
To encode the immutability of the structure? Changing the structure of this object is meaningless so why allow it? Maybe I am over thinking this though.
Fixes
Part of a broader TS-ification project and necessary for TS-ifying the last blocking component: VPopover.
Description
Updates
useWindowScroll
to use TypeScript and adds unit tests. Also removes the usage of deprecated window properties.Testing Instructions
Ensure CI and e2e tests work as expected.
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin