Post the event data only once there is at least one handler candidate to handle it.
When evt.isHandled(data) return true, post(data) is invoked synchronously and the new post count is returned. When postAsyncOnceHandled(data) is invoked at a time whereevt.isHandled(data) returns false, the data will be kept on hold and posted only once a candidate handler is attached.
evt.post(data) is not invoked synchronously as soon as the candidate handler is attached but is scheduled to be invoked in a microtask.
When the call to post is delayed postAsyncOnceHandled(data) returns a promise that resolves with the new post count after post(data) has been invoked.
evt.postSyncOnceHandled() does not exist because it is preferable to wait for the next event cycle before posting the event. For example, the previous example would not print "2 foo" if we had used evt.postSyncOnceHandled()
Flavor of post that returns a promise that resolves after all asynchronous Handler's callbacks that matches the event data has resolved.