Open amorfati254 opened 1 year ago
I can confirm the same thing.
Debounce
in the context recommended by documentation is throwing a type error, because this.*
is always returning a string.
Its probably related to https://github.com/kenkunz/svelte-fsm/issues/6
Also, I looked at the source code and conclude that debounce is late binding?
By making a Typescript type assertion, I was able to satisfy the ts check.
interface SetWithDebounce {
debounce: (delay: number) => void;
}
.....
updatingHost: {
_enter() {
SourceOfChange.set('ui');
(this.set as unknown as SetWithDebounce).debounce(1)
},
set: 'ready'
}
this.advance.debounce shows TS error
debounce does not exist on type string