Create a Command from a given function, for use with ViewModels. A Command is a function with an extra
canExecuteobservable property to determine whether the command can be executed. When executed, a Command function will check the value of
canExecuteand throw if false. It also provides events for when a command has been or is about to be executed.
||function||The function to execute.|
||optional A boolean indicating whether the function can currently be executed.|