Skip to content

Identify command that triggered callback

Compare
Choose a tag to compare
@JamesBrill JamesBrill released this 15 Dec 15:18
· 89 commits to master since this release
88a7f82

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
    }