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

Migrate to vite + typescript and add Context #2

Open
JuanGuerrero09 opened this issue Mar 10, 2023 · 4 comments
Open

Migrate to vite + typescript and add Context #2

JuanGuerrero09 opened this issue Mar 10, 2023 · 4 comments
Assignees

Comments

@JuanGuerrero09
Copy link
Contributor

As we talked previously I'll migrate to Vite + Typescript the apps. Also I wanted to suggest add Context to manage the state of the exercises globally instead of having it in the list component

@nikhilkarve
Copy link
Owner

If you have created a branch with migration code, send me a PR, I will merge, I will also suggest you to update README accordingly, and the changes one will have to do to run the project if any.

Right now data is in localStorage so can be accessed from anywhere, I have not used context for now, because there arent many components so didn't feel the need to add the extra bit. Right now we can work with localStorage. I will probably change the way I have implemented localStorage logic and use a hook which is there for that specific purpose.

@JuanGuerrero09
Copy link
Contributor Author

Hi, I'm on it, I'll create a readme with that.
About the context, you can use context and keep the data in the local storage, context help us making that the state (the leetcode exercises information) available for all the components that need it, and avoiding prop drilling (that was the main problem that I found trying to refactor it with typescript, having a lot of props).
With that you can keep the state in a more global way, and that could help when creating a new exercise (since the form component could change the state, and the exercise list can be updated automatically since it would re render after that)

@nikhilkarve
Copy link
Owner

Sorry for the late reply, I was busy with other commitments. I understand, please do things you feel necessary or would make your life easier. Create a PR when done.

@JuanGuerrero09
Copy link
Contributor Author

Hi, sorry to you as well, I had to finish some things here (since I'll move out of the country in two weeks), I'll work in this, and I'll try to have it before Wednesday.

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

No branches or pull requests

2 participants