Closed Rettend closed 4 months ago
😮 this is new to me
okay here we go if you haven't looked it up yet:
// we have an object type
type User = {
id: number
name: string
}
// user is of type User
const user: User = {
id: 1,
name: 'asd'
}
// user's type is { id: number, name: string }
const user = {
id: 1,
name: 'asd'
} satisfies User
so satisfies
will keep the inferred type, but will still provide typechecking for user.
In our case, both would work, but there are cases where you have to use satisfies
thanks for your work cleaning things up!
bun i
was significantly faster thannpm i
on my mac :Dalso, what exactly was the problem you discovered with Item tests?!
because of how we used events like deleteItem, when the quantity was 1 and you pressed the left arrow, it would not decrease it (because it would return early). so i increased the quantity to 2, and made two tests, one where it should decrease quantity and one where it should call the delete event.
i'm not sure how to write this clearer
src
folder (like component files being inroutes
:D )$bindable
prop:stores/item.svelte.ts
, and it encapsulates its methods