|
|
|
|
|
by bebrws
1233 days ago
|
|
There are a ton of other approaches that would work with NodeJS that would be even more simple though right?
The easiest or first that comes to mind is just have your function that does whatever functionality is required for creating this assetsManifest (whatever both compileServer and compileBrowser depend on). Lets call this createAssetsManifest. Then you have your 2 compile async functions but you just don't await on them and let them run without using the await keyword. const manifest = await createAssetsManifest();
compileBrowser(manifest);
compileServer(manifest);
I am wondering if since the creation of async/await that the idea behind callbacks and async operations in general in Node has been forgotten.Not referring to the author or anyone in particular. Just a thought since these keywords might used so often by engineers new to Node that they might not have ever learned what came before? |
|