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

use destructuring, your code will be very good #50

Open
MohammadAlhalaq opened this issue Jul 25, 2019 · 1 comment
Open

use destructuring, your code will be very good #50

MohammadAlhalaq opened this issue Jul 25, 2019 · 1 comment

Comments

@MohammadAlhalaq
Copy link

handle.handleHome(request,response);
}else if(endpoint.includes('/public')){
handle.handlePages(request,response);
}else if (endpoint === "/data") {
handle.handleData(request,response);

@MohammadAlhalaq
Copy link
Author

this old

const handle = require('./handlerData')

this new

const {handleHome, handlePages, handlePages} = require('./handlerData') 

execute directly

     handleHome(request,response); 
 }else if(endpoint.includes('/public')){ 
     handlePages(request,response); 
 }else if (endpoint === "/data") { 
     handleData(request,response); 

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

1 participant