createCommand
Create a Command from a given function, for use with ViewModels.
A Command is a function with an extra canExecute observable property to determine
whether the command can be executed. When executed, a Command function will check the
value of canExecute and throw if false.
Parameters:
| Name | Type | Argument | Default | Description |
|---|---|---|---|---|
func |
Function | The function to execute. | ||
canExecute |
Observable |
<optional> |
true | An observable indicating if the function can currently be executed. |
