-
Notifications
You must be signed in to change notification settings - Fork 44
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
upkeep: add TS support for useIsPluginActive
hook
#297
Conversation
Size Change: -7 B (0%) Total Size: 65.7 kB
|
hooks/use-is-plugin-active/index.ts
Outdated
|
||
const isPluginActive: boolean = ACTIVE_STATUSES.includes(plugin?.status); | ||
|
||
return [isPluginActive, hasResolvedPlugins] as [boolean, boolean]; |
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.
Why is the as required here? Shouldn't it already know that due yo the earlier types?
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.
Ahh that is because you manually typed the return of the function. We can leave that off. It can get inferred :)
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've still moved that logic here 7c5ee73 for clarity.
1 failed test on run #758 ↗︎
Details:
cypress/e2e/IconPicker.spec.js • 1 failed test
Review all test suite changes for PR #297 ↗︎ |
1865da5
to
7c5ee73
Compare
…omponents into upkeep/use-is-plugin-active
useIsPluginActive
hook
Description of the Change
Converts the useIsPluginActive hook to TypeScript.
Closes #
How to test the Change
Changelog Entry
Credits
Props @fabiankaegy @Sidsector9
Checklist: