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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Second argument of tweened.set is not optional in TypeScript #5062

Closed
TechInterMezzo opened this issue Jun 24, 2020 · 1 comment · Fixed by #5068
Closed

Second argument of tweened.set is not optional in TypeScript #5062

TechInterMezzo opened this issue Jun 24, 2020 · 1 comment · Fixed by #5068
Labels

Comments

@TechInterMezzo
Copy link

TechInterMezzo commented Jun 24, 2020

You can't use the following code in TypeScript because it gives an error that it expects a second argument.
That would be the options argument but it should be optional looking at the docs.

import { tweened } from 'svelte/motion';
let test = tweened(0);
test.set(100);
$test = 0;

Even $test = 0 fails because of an expected second argument.

You can find the type declaration here:

set(value: T, opts: Options<T>): Promise<void>;

Maybe there are event more bugs like that in other type declerations but I didn't check them yet.

@Conduitry
Copy link
Member

The types should be fixed in 3.24.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants