Permalink
Browse files

Start exposing RCTWebSocketObserver using a protocol

Reviewed By: javache

Differential Revision: D4296387

fbshipit-source-id: 33f92c36168dcb18356d0ccdaf902a84634d94b7
  • Loading branch information...
adamjernst authored and mkonicek committed Dec 8, 2016
1 parent 7a8410b commit 48cb8d3f9286c8d55338bea57cda402db415a2f1
@@ -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;

0 comments on commit 48cb8d3

Please sign in to comment.