Skip to content

let onDispatch signal "handled" #13

@billba

Description

@billba

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions