UNPKG

546 BPlain TextView Raw
1/*
2 * Copyright (c) Facebook, Inc. and its affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#import "RCTWeakProxy.h"
9
10@implementation RCTWeakProxy
11
12- (instancetype)initWithTarget:(id)target
13{
14 if (self = [super init]) {
15 _target = target;
16 }
17 return self;
18}
19
20+ (instancetype)weakProxyWithTarget:(id)target
21{
22 return [[RCTWeakProxy alloc] initWithTarget:target];
23}
24
25- (id)forwardingTargetForSelector:(SEL)aSelector
26{
27 return _target;
28}
29
30@end