Immediately resolving promise to retrieve command. Rejected with Error when command is not found. Rejecting with CommandNotFoundError on error.
Error
CommandNotFoundError
editor instance
command name to search for
ifCommand(editor, commandName).then(handler).catch(optionalCommandNotFound); Copy
ifCommand(editor, commandName).then(handler).catch(optionalCommandNotFound);
Immediately resolving promise to retrieve command. Rejected with
Error
when command is not found. Rejecting withCommandNotFoundError
on error.