-
Couldn't load subscription status.
- Fork 8
chore: make context flavor transformative #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
base: main
Are you sure you want to change the base?
Conversation
BREAKING CHANGE: I18nFlavor now needs to be used as I18nFlavor<Context>
| type MyContext = | ||
| & Context | ||
| & I18nFlavor | ||
| & I18nFlavor<Context> |
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.
Those aren't correctly combined
| type MyContext = | ||
| & Context | ||
| & I18nFlavor | ||
| & I18nFlavor<Context> |
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.
Same here
| ctx: C, | ||
| ): ctx is HearsContext<C> { | ||
| export function hears<C extends Context>(key: string) { | ||
| return function <TContext extends I18nFlavor<C>>( |
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 wonder if this is better than removing the type parameter from hears and then doing
| return function <TContext extends I18nFlavor<C>>( | |
| return function <C extends Context, CTContext extends I18nFlavor<C>>( |
|
I don't think you should target main just yet |
Related to grammyjs/grammY#709