ReactiveCocoa/ReactiveCocoa — pull request #733 by jspahrsummers (2013-08-04 08:12:40+00:00)
Title: Make commands less special, compose better

**:warning: NOT READY TO MERGE :warning:**

This is a potential fix for #665 and #731, opened early because it warrants a _lot_ of discussion.

**Major changes:**

- Replaced `-addActionBlock:` with an initializer that accepts a block of the same type. Ironically, this makes `RACCommand` look kinda similar to the [pre-1.0 version](https://github.com/ReactiveCocoa/ReactiveCocoa/blob/49f4b9c90d8f5290a8145892f21171c01fb883c8/ReactiveCocoaFramework/ReactiveCocoa/RACCommand.h).
- `-execute:` now returns a signal which represents that single execution.
- `RACCommand` now sends signals to its subscribers (i.e., it behaves like a signal-of-signals).
- `RACCommand` now accepts sent events — again, similar to the [pre-1.0 version](https://github.com/ReactiveCocoa/ReactiveCocoa/blob/49f4b9c90d8f5290a8145892f21171c01fb883c8/ReactiveCocoaFramework/ReactiveCocoa/RACCommand.h).
- Moved all `executing` and `errors` inspection out of `RACCommand` and into operators for manipulating the inner signals from a signals-of-signals, similar to what was proposed in #388 and #687.

The changes probably won't make much sense without seeing [how it's used](https://gist.github.com/jspahrsummers/80f301227a01b36c9495). The key here is that commands can now be [chained](https://gist.github.com/jspahrsummers/80f301227a01b36c9495#file-gistfile1-m-L59-L68) in a meaningful and very natural way.

If this is interesting, the next question is when the change should be made. 2.0's got a lot of stuff in it already, and I'd hate to introduce such a big change so late… but I'd also hate to wait for the next major release if we think this is a significant improvement.

P.S. Shout out to @jonsterling for helping me think through what a command is and what it should be like! :zap:

**To do:**

- [ ] Refactor `RACCommand` implementation.
- [ ] Implement new `RACSignal` operators.
- [ ] Unit test `RACCommand`.
- [ ] Unit test new `RACSignal` operators.
- [ ] Add a migration path from old `RACCommand` interface.
- [ ] Update the changelog.

@xpaulbettsx @Haacked