ToP29 / GWI-challenge

0 stars 0 forks source link

Hello! Assignment review #1

Open padelis opened 9 months ago

padelis commented 9 months ago

Hey Tomas! Thanks a lot for doing the challenge! I'll add some comments/questions if you want to answer them.

Nice! what's the difference with useState?

export const page = signal(0)
export const breeds: Signal<Breed[]> = signal([])

I see this definition twice, is this intentional?

export type Breed = {
...

Also there are some unused vars. How so?

    const breedsQuery = useQuery({
        queryKey: ['breeds'],
        queryFn: getInitialBreeds
    })

And another question do you have any experience with testing frameworks/libs?

ToP29 commented 9 months ago

Hello Padelis, here are few videos explaining Why Signals Are Better Than React Hooks, Goodbye, useEffect - David Khourshid In short, signals are faster, can be easily put to separate file (separation of concerns) and wont cause unintentional rerenders. Before I started the challenge, I did some research how to write modern react, because my last project was in svelte and I didnt see react for couple of years. And in that research i found that you should avoid overusing 'useEffect' so I did just that.

Second one is good catch. I created breeds module as copy/paste from cats and forgot second types.ts file in there 🙈

These unused consts I left there for debugging. I had console logs there, and removed them before submitting the challenge. I left declarations there because of habbit. I do that so if I come back and I need to log this, I dont have to name it again.

About my experience with testing libraries. In past I worked with Cypress, Karma and Jest. More recently I worked with Playwright and Vitest.

padelis commented 9 months ago

Thanks a ton for sharing your resources I'll have a look!

These unused consts I left there for debugging. I had console logs there, and removed them before submitting the challenge. I left declarations there because of habbit. I do that so if I come back and I need to log this, I dont have to name it again.

FWIW we do use react query as well and their devtools I find them handy ;)

ToP29 commented 9 months ago

Oh, I didnt know they had dev tools 🙈 Thanks for the tip 😊