I just came across a theory that postMessage in Google Chrome is similar to nextTick. This idea somewhat confused me because I was under the impression that postMessage was primarily used for communication between web workers.
Experimenting with expressions like
postMessage(function() {return;});
, I realized it doesn't schedule a function to run when the event loop is idle, but instead returns an error. It appears that postMessage strictly accepts a message as input.
Is there a way to leverage postMessage for scheduling function calls during idle times in the event loop?