Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identify command that triggered callback #77

Merged
merged 1 commit into from
Dec 15, 2020

Conversation

JamesBrill
Copy link
Owner

To enable consumers that provide an array of command phrases for the same command callback, the lib now passes in the matched command phrase back to the callback. This is passed in through the last argument as the command property. Example:

    {
      command: ['Hello', 'Hi'],
      callback: ({ command }) => setMessage(`Hi there! You said: "${command}"`),
      matchInterim: true
    }

@JamesBrill JamesBrill merged commit 88a7f82 into master Dec 15, 2020
@JamesBrill JamesBrill deleted the pass-matched-command-into-callback branch December 15, 2020 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant