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
|
#if RCT_DEV // Only supported in dev mode
|
||||||
|
|
||||||
|
@interface RCTWebSocketObserver : NSObject <RCTWebSocketObserver>
|
||||||
|
@end
|
||||||
|
|
||||||
@interface RCTWebSocketManager : NSObject <RCTWebSocketProxy>
|
@interface RCTWebSocketManager : NSObject <RCTWebSocketProxy>
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -20,18 +20,15 @@
|
||||||
|
|
||||||
#pragma mark - RCTWebSocketObserver
|
#pragma mark - RCTWebSocketObserver
|
||||||
|
|
||||||
@interface RCTWebSocketObserver : NSObject <RCTSRWebSocketDelegate> {
|
@interface RCTWebSocketObserver () <RCTSRWebSocketDelegate>
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation RCTWebSocketObserver {
|
||||||
NSURL *_url;
|
NSURL *_url;
|
||||||
RCTSRWebSocket *_socket;
|
RCTSRWebSocket *_socket;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithURL:(NSURL *)url;
|
@synthesize delegate = _delegate;
|
||||||
|
|
||||||
@property (nonatomic, weak) id<RCTWebSocketProxyDelegate> delegate;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation RCTWebSocketObserver
|
|
||||||
|
|
||||||
- (instancetype)initWithURL:(NSURL *)url
|
- (instancetype)initWithURL:(NSURL *)url
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,6 +12,13 @@
|
||||||
|
|
||||||
#if RCT_DEV // Only supported in dev mode
|
#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
|
@protocol RCTWebSocketProxy
|
||||||
|
|
||||||
+ (instancetype)sharedInstance;
|
+ (instancetype)sharedInstance;
|
||||||
|
|
Loading…
Reference in New Issue