TDSNetSubscriber.h 584 B

1234567891011121314151617181920212223242526272829
  1. //
  2. // TDSNetSubscriber.h
  3. // TDSCommon
  4. //
  5. // Created by Insomnia on 2020/10/22.
  6. //
  7. #import <Foundation/Foundation.h>
  8. @protocol TDSNetSubscriber <NSObject>
  9. @optional
  10. - (void)sendSuccess:(nullable id)value;
  11. - (void)sendFailure:(nullable NSError *)error;
  12. - (void)sendProgress:(nullable id)progress;
  13. @end
  14. NS_ASSUME_NONNULL_BEGIN
  15. @interface TDSNetSubscriber : NSObject<TDSNetSubscriber>
  16. + (instancetype)subscriberWithSuccess:(void (^)(id x))success failure:(nullable void (^)(NSError *error))error progress:(nullable void (^)(id progress))progress;
  17. @end
  18. NS_ASSUME_NONNULL_END