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

refactor: refactor use progress hook #241

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Iyadchafroud
Copy link

make handle as const there is no need to state
add interface progresshook
verification xhr.lengthComputable valide to calclul new progress create handleUploadProgress in use effect to create it only when we needed and Encapsulated it verify new progress in the handleuploadprogress to lake it clean and to avoid extra effect Cleanup event listener on unmount or when files change

make handle as const there is no need to state
add interface progresshook
verification xhr.lengthComputable valide to calclul new progress
create handleUploadProgress in use effect to create it only when we needed and Encapsulated it
verify new progress in the handleuploadprogress to lake it clean and to avoid extra effect
Cleanup event listener on unmount or when files change
add JSDoc .
return `true` immediately if any file or criter to match  for improving performance.
accepted file types to lowercase to be sure about case-insensitive
Removed unnecessary regex and replaced it with simple method
Encapsulated  logic in Array.some()
@bassem97
Copy link
Contributor

@Iyadchafroud please fix prettier by running :
pnpm prettier-write

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

Successfully merging this pull request may close these issues.

2 participants