Start exposing RCTWebSocketObserver using a protocol
Reviewed By: javache Differential Revision: D4296387 fbshipit-source-id: 33f92c36168dcb18356d0ccdaf902a84634d94b7
This commit is contained in:
parent
574e3daf9f
commit
2ca6138852
|
@ -12,6 +12,9 @@
|
|||
|
||||
#if RCT_DEV // Only supported in dev mode
|
||||
|
||||
@interface RCTWebSocketObserver : NSObject <RCTWebSocketObserver>
|
||||
@end
|
||||
|
||||
@interface RCTWebSocketManager : NSObject <RCTWebSocketProxy>
|
||||
@end
|
||||
|
||||
|
|
|
@ -20,18 +20,15 @@
|
|||
|
||||
#pragma mark - RCTWebSocketObserver
|
||||
|
||||
@interface RCTWebSocketObserver : NSObject <RCTSRWebSocketDelegate> {
|
||||
@interface RCTWebSocketObserver () <RCTSRWebSocketDelegate>
|
||||
@end
|
||||
|
||||
@implementation RCTWebSocketObserver {
|
||||
NSURL *_url;
|
||||
RCTSRWebSocket *_socket;
|
||||
}
|
||||
|
||||
- (instancetype)initWithURL:(NSURL *)url;
|
||||
|
||||
@property (nonatomic, weak) id<RCTWebSocketProxyDelegate> delegate;
|
||||
|
||||
@end
|
||||
|
||||
@implementation RCTWebSocketObserver
|
||||
@synthesize delegate = _delegate;
|
||||
|
||||
- (instancetype)initWithURL:(NSURL *)url
|
||||
{
|
||||
|
|
|
@ -12,6 +12,13 @@
|
|||
|
||||
#if RCT_DEV // Only supported in dev mode
|
||||
|
||||
@protocol RCTWebSocketProxyDelegate;
|
||||
|
||||
@protocol RCTWebSocketObserver
|
||||
- (instancetype)initWithURL:(NSURL *)url;
|
||||
@property (nonatomic, weak) id<RCTWebSocketProxyDelegate> delegate;
|
||||
@end
|
||||
|
||||
@protocol RCTWebSocketProxy
|
||||
|
||||
+ (instancetype)sharedInstance;
|
||||
|
|
Loading…
Reference in New Issue