It might be useful to let onDispatch signal that it has handled the utterance.
The simplest thing would be to return true if the utterance was handled. But handling the utterance is probably the default. It would be ideal if you only had to write extra code if you didn't handle the utterance.
So maybe return false if you didn't handle it? Anything else, including no return, would be considered "handled".
Then the following has new meaning (and value):
if (await this.onDispatchToChild()) {
// no child, or it didn't handle it
}
Question: would it ever be useful to distinguish between the two cases? Actually we know if we have a child, so that's easy to figure out.
It might be useful to let
onDispatchsignal that it has handled the utterance.The simplest thing would be to return
trueif the utterance was handled. But handling the utterance is probably the default. It would be ideal if you only had to write extra code if you didn't handle the utterance.So maybe return
falseif you didn't handle it? Anything else, including no return, would be considered "handled".Then the following has new meaning (and value):
Question: would it ever be useful to distinguish between the two cases? Actually we know if we have a child, so that's easy to figure out.