Proposed improvement to Command
Proposed improvement to Command

Two things here. First, I think the command should check that it canExecute() before it actually executes. There is comment in Button that it should check canExecute() before calling execute(), but I don't think Command should trust the invokers of execute() to have first checked canExecute().

Second, I think there are cases for calling execute() with params, such as callback functions. I've been setting Command.callback to a default callback and using it, but I think there are cases where you might want to build a callback and use it once instead of overriding the default .callback. Updating the base execute() to pass arguments to _execute() helps facilitate this.
If these changes are reaching outside of the pattern, then let's discuss.
Livefyre/livefyre-bootstrap,Livefyre/livefyre-bootstrap,Livefyre/livefyre-bootstrap