Inherits from RACDisposable : NSObject
Declared in RACCompoundDisposable.h

Overview

A disposable of disposables. When it is disposed, it disposes of all its contained disposables.

If addDisposable: is called after the compound disposable has been disposed of, the given disposable is immediately disposed. This allows a compound disposable to act as a stand-in for a disposable that will be delivered asynchronously.

Tasks

  • + compoundDisposable

    Creates and returns a new compound disposable.

  • + compoundDisposableWithDisposables:

    Creates and returns a new compound disposable containing the given disposables.

  • – addDisposable:

    Adds the given disposable. If the receiving disposable has already been disposed of, the given disposable is disposed immediately.

  • – removeDisposable:

    Removes the specified disposable from the compound disposable (regardless of its disposed status), or does nothing if it’s not in the compound disposable.

Class Methods

compoundDisposable

Creates and returns a new compound disposable.

+ (instancetype)compoundDisposable

Discussion

Creates and returns a new compound disposable.

Declared In

RACCompoundDisposable.h

compoundDisposableWithDisposables:

Creates and returns a new compound disposable containing the given disposables.

+ (instancetype)compoundDisposableWithDisposables:(NSArray *)disposables

Discussion

Creates and returns a new compound disposable containing the given disposables.

Declared In

RACCompoundDisposable.h

Instance Methods

addDisposable:

Adds the given disposable. If the receiving disposable has already been disposed of, the given disposable is disposed immediately.

- (void)addDisposable:(RACDisposable *)disposable

Discussion

Adds the given disposable. If the receiving disposable has already been disposed of, the given disposable is disposed immediately.

This method is thread-safe.

disposable - The disposable to add. This may be nil, in which case nothing happens.

Declared In

RACCompoundDisposable.h

removeDisposable:

Removes the specified disposable from the compound disposable (regardless of its disposed status), or does nothing if it’s not in the compound disposable.

- (void)removeDisposable:(RACDisposable *)disposable

Discussion

Removes the specified disposable from the compound disposable (regardless of its disposed status), or does nothing if it’s not in the compound disposable.

This is mainly useful for limiting the memory usage of the compound disposable for long-running operations.

This method is thread-safe.

disposable - The disposable to remove. This argument may be nil (to make the use of weak references easier).

Declared In

RACCompoundDisposable.h