Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃敤 overload in TS & avoid assertion #289

Merged
merged 1 commit into from
Apr 3, 2024
Merged

Conversation

AuroraTea
Copy link
Contributor

@AuroraTea AuroraTea commented Mar 20, 2024

Description

  1. TS will error with No overload match...
  2. There is no need to use assertion to abandon type inference at this point.

Now it appears to be repeating itself, but in reality, one is taking CookieOptions & {readonly: true;} as input and returning Readonly<CookieRef>, while the other is taking CookieOptions & {readonly: false | undefined;} as input and returning CookieRef. This way, it aligns with the appropriate overload call pattern.

It appears to be repeating itself, but in reality, one is taking CookieOptions<T> & {readonly: true;} as input and returning Readonly<CookieRef<T>>, while the other is taking CookieOptions<T> & {readonly: true;} as input and returning CookieRef<T>. This way, it aligns with the appropriate overload call pattern.
@prazdevs prazdevs merged commit 8ec840f into prazdevs:main Apr 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants