ReactiveCocoa/ReactiveCocoa — pull request #922 by brow (2013-11-07 19:16:12+00:00)
Title: RACCommand disable at initialization time

I'm implementing a command that should be disabled from the moment that it is initialized until some other event occurs. I found that was impossible:

RACCommand *command = [[RACCommand alloc] initWithEnabled:[RACSignal return:@NO] signalBlock:^(id _) {
return [RACSignal empty];
}];
expect([command.enabled first]).to.equal(@NO); // fails

This pull makes it so that if enabledSignal sends a value at the time the command is initialized, then `-[RACCommand enabled]` sends that value synchronously before the initializer returns.