-
Notifications
You must be signed in to change notification settings - Fork 58
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(tokens, vital-demo): Storybook 2023 #2202
base: main
Are you sure you want to change the base?
Conversation
…tw-3' into feature/token-demo
…tw-3' into token-demo-origin
…tw-3' into feature/token-demo
…tw-3' into feature/token-demo
); | ||
this.add(tokens); | ||
return this; | ||
// TBD Conflict resolution |
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.
@salikn --
Lines 59 - 62 was what was on MAIN a year ago.
Lines 64 - 66 was is on MAIN today. From what I can tell we update the token to HOCWithMEta to access token?.meta?
Chris replaced addCollection (lines 47-56)
that all seems to work.. and will delete all these lines but I think its useful to see and sets up for my question.
class TokenMap<P> { | ||
protected map = new Map<string, HOC>(); | ||
const extractMeta = (token?: Token): TokenMeta => { | ||
// TODO error TS2339: Property 'meta' does not exist on type 'HOC<{}, {}, {}>'. |
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.
@salikn
Line 25 gives type error in line 24 comment.
I played with switching token?: HOCWithMeta but it really messes up a lot of other things so not sure what was right move.
So not sure how to fix type error. Ideas?
And obviosuly I would delete line 26 once I fix type error.
// if (typeof token === 'function') return token?.meta || {}; | ||
if (typeof token === 'function') return {}; | ||
if (typeof token === 'string') return {}; | ||
return (token as TokenSpec<any, any>)?.Meta || {}; |
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.
@salikn correct way to fix this type error?
(Typescript in javascript is not my expertise and I just find it PITA. )
Changes
Updated: #1648
Test Instructions
Storybook (run from vital-demo)
Related Issues