Saturday 25 May 2019

Are Callbacks necessary when writing modular code?

I'm new to Node. I've been working on a small project and recently found my main js file is getting cluttered so I wanted to structure it in a way where it can continue to grow without becoming impossible to understand.So I separated related functions into different files and simply exported the function that gets called, but now that function can't call the main event function as it's in a different file. Is a callback my only option? I've been trying to avoid them as much as possible to avoid confusion later on in development.

Submitted May 26, 2019 at 02:21AM by DangerDeloach

No comments:

Post a Comment