title: Reactive Cocoa Conditional Delay
body: <p>I'm trying to wrap my head around the ReactiveCocoa framework, but I'm stuck on trying to figure out how to delay conditionally.</p>
  
  <p>For example, I want to set a CADisplayLink pause property to false when an array is empty. Here is how I accomplished this :</p>
  
  <pre><code>RACSignal *changeSignal = [self rac_valuesAndChangesForKeyPath:@keypath(self, projectiles) options:NSKeyValueObservingOptionNew observer:nil];
  
  RAC(self.displayLink, paused) = [changeSignal map:^id(RACTuple *value) {
      return @([((NSMutableArray *)value.first) count] == 0);
  }];
  </code></pre>
  
  <p>But before I pause the display link, I want to keep animating for a few seconds, so I added a <code>delay:2.5];</code> to the end of the map block.</p>
  
  <p>Now I'm running into the problem that it's waiting 2.5 seconds to stop AND start the display link. I only want RAC to pause when I'm setting the <code>self.displayLink.paused</code> to <code>YES</code> but not when I'm setting it to <code>NO</code>.</p>
  
  <p>Is this type of "conditional delay" possible in ReactiveCocoa, and if so, how is it done?</p>