//
//  NSObject+YSRACDeallocating.h
//  ReactiveObjC
//
//  Created by Kazuo Koga on 2013/03/15.
//  Copyright (c) 2013 GitHub, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

@class YSRACCompoundDisposable;
@class YSRACDisposable;
@class YSRACSignal<__covariant ValueType>;

NS_ASSUME_NONNULL_BEGIN

@interface NSObject (YSRACDeallocating)

/// The compound disposable which will be disposed of when the receiver is
/// deallocated.
@property (atomic, readonly, strong) YSRACCompoundDisposable *ysrac_deallocDisposable;

/// Returns a signal that will complete immediately before the receiver is fully
/// deallocated. If already deallocated when the signal is subscribed to,
/// a `completed` event will be sent immediately.
- (YSRACSignal *)ysrac_willDeallocSignal;

@end

NS_ASSUME_NONNULL_END
