RACSubject.h 749 B

1234567891011121314151617181920212223242526272829
  1. //
  2. // RACSubject.h
  3. // ReactiveObjC
  4. //
  5. // Created by Josh Abernathy on 3/9/12.
  6. // Copyright (c) 2012 GitHub, Inc. All rights reserved.
  7. //
  8. #import "RACSignal.h"
  9. #import "RACSubscriber.h"
  10. NS_ASSUME_NONNULL_BEGIN
  11. /// A subject can be thought of as a signal that you can manually control by
  12. /// sending next, completed, and error.
  13. ///
  14. /// They're most helpful in bridging the non-RAC world to RAC, since they let you
  15. /// manually control the sending of events.
  16. @interface RACSubject<ValueType> : RACSignal<ValueType> <RACSubscriber>
  17. /// Returns a new subject.
  18. + (instancetype)subject;
  19. // Redeclaration of the RACSubscriber method. Made in order to specify a generic type.
  20. - (void)sendNext:(nullable ValueType)value;
  21. @end
  22. NS_ASSUME_NONNULL_END