|
|
|
|
|
by ricardobeat
1233 days ago
|
|
It's a bit out of fashion, but same thing can be achieved without any extra code using a built-in EventEmitter: let channel = new EventEmitter()
await Promise.all([
compile.browser(channel),
compile.server(channel)
])
// in compile.browser
channel.emit("manifest", assetsManifest)
// in compile.server
channel.once("manifest", (assetsManifest) => ... )
A new emitter is used each time, so the end result is the same. Curious to hear what others think. |
|