rmsmith/undone — pull request #12 by danschultz (2014-03-04 03:09:27+00:00)
Title: Add labels to actions

This adds labels to actions. These labels can be used for displaying to the user the action that is going to be undone.

This pull request includes breaking changes to the public API:

* Use named parameters instead of argument lists on `Action`'s constructors. This makes it easier to specify option subsets when calling a function. For example, if a developer wants to specify a label, but not the delay for a async action, she can do `new Action(obj, (_) {...}, (_, __) {...}, label: "My action")`. Otherwise, you'd need to pass in the default timeout when it's already defined in the arguments.
* The undo action is now required. Since constructor arguments are now named params, it's ugly to have `undo` as a named param, like so: `new Action(obj, (_) {...}, undo: (_, __) {...})`. It's not clear to me when you wouldn't want to specify an undo action, but in the case that you do, you can just pass in `null` or better yet, create a named constructor for this. Maybe `Action.nonUndoable()`?

Closes #11.