Skip to content
Snippets Groups Projects
Commit 30697c9b authored by Jorge Canizales's avatar Jorge Canizales
Browse files

Imports code of the RX library.

parent f0ee5452
No related branches found
No related tags found
No related merge requests found
#import "GRXMappingWriter.h"
static id (^kIdentity)(id value) = ^id(id value) {
return value;
};
@interface GRXWriter () <GRXWriteable>
@end
@implementation GRXMappingWriter {
id (^_map)(id value);
}
- (instancetype)initWithWriter:(id<GRXWriter>)writer {
return [self initWithWriter:writer map:nil];
}
// Designated initializer
- (instancetype)initWithWriter:(id<GRXWriter>)writer map:(id (^)(id value))map {
if ((self = [super initWithWriter:writer])) {
_map = map ?: kIdentity;
}
return self;
}
// Override
- (void)didReceiveValue:(id)value {
[super didReceiveValue:_map(value)];
}
@end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment