Inherits from RACSubject : RACSignal : RACStream : NSObject
Declared in RACReplaySubject.h
RACReplaySubject.m

Overview

A replay subject saves the values it is sent (up to its defined capacity) and resends those to new subscribers. It will also replay an error or completion.

Class Methods

replaySubjectWithCapacity:

Creates a new replay subject with the given capacity. A capacity of RACReplaySubjectUnlimitedCapacity means values are never trimmed.

+ (instancetype)replaySubjectWithCapacity:(NSUInteger)capacity

Declared In

RACReplaySubject.h

Instance Methods

sendCompleted

Send completed to subscribers.

- (void)sendCompleted

Discussion

This terminates the subscription, and invalidates the subscriber (such that it cannot subscribe to anything else in the future).

Declared In

RACSubscriber.h

sendError:

Send the error to subscribers.

- (void)sendError:(NSError *)e

Discussion

error - The error to send. This can be nil.

This terminates the subscription, and invalidates the subscriber (such that it cannot subscribe to anything else in the future).

Declared In

RACSubscriber.h

sendNext:

Send the next value to subscribers.

- (void)sendNext:(id)value

Discussion

value - The value to send. This can be nil.

Declared In

RACSubscriber.h

subscribe:

Subscribes subscriber to changes on the receiver. The receiver defines which events it actually sends and in what situations the events are sent.

- (RACDisposable *)subscribe:(id<RACSubscriber>)subscriber

Discussion

Subscription will always happen on a valid RACScheduler. If the [RACScheduler currentScheduler] cannot be determined at the time of subscription (e.g., because the calling code is running on a GCD queue or NSOperationQueue), subscription will occur on a private background scheduler. On the main thread, subscriptions will always occur immediately, with a [RACScheduler currentScheduler] of [RACScheduler mainThreadScheduler].

This method must be overridden by any subclasses.

Returns nil or a disposable. You can call [RACDisposable dispose] if you need to end your subscription before it would “naturally” end, either by completing or erroring. Once the disposable has been disposed, the subscriber won’t receive any more events from the subscription.

Declared In

RACSignal.h