Rishabh-malhotraa / caucus

Realtime Collaborate Editor with Embedded Compiler
https://caucus.rishabhmalhotra.in/
MIT License
297 stars 70 forks source link

Refactor Code for roomID extractions #22

Closed Rishabh-malhotraa closed 3 years ago

Rishabh-malhotraa commented 3 years ago

Motivation

I want to adhere to the DRY concept in programming (Don't Repeat Yourself)

Description

In many files, I have resued the logic to extract the param id from the URL. Firstly I thought I wouldn't need it but then I have rewritten the same code in different files several times.

A better implementation would be to use context and store it as a part of the global state

import { useParams } from "react-router-dom";
const { id } = useParams<Record<string, string>>();
dipenr06 commented 3 years ago

Hey @Rishabh-malhotraa , I would like to work on this please.. and please guide me on how can i contribute to this as i'm new here 😅

Rishabh-malhotraa commented 3 years ago

You should start by setting up the project locally, make the required changes, and make a pull request. I'll then do a code review on your changes and give you feedback, if needed; and then your PR will be merged to the codebase :).

dipenr06 commented 3 years ago

sure thank you so much

MarufSharifi commented 3 years ago

Hey @Rishabh-malhotraa , could i solve this issue

MarufSharifi commented 3 years ago

Hi @Rishabh-malhotraa, I have just cloned this repository and after that i installed dependencies, but unfortunately if face to this issue

Can't resolve 'tsparticles' in '/home/manujtiwari/Desktop/portfolio-react/node_modules/react-particles-js/cjs'

I have solved the issue by installing "tsparticles" npm package . should i commit the change that i have made to this repository

Rishabh-malhotraa commented 3 years ago

@MarufSharifi Sure go right ahead, make a pr and I'll merge it

MarufSharifi commented 3 years ago

I had made pr, please check.

MarufSharifi commented 3 years ago

Hey @Rishabh-malhotraa, thanks a lot for helping me, the problem have gone, when i used npm to install packages, because of that i closed the pr and deleted that branch. right now i am working on this issue