RCTImageURLLoaderWithAttribution.mm 664 B

123456789101112131415161718192021222324252627282930
  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. #import "RCTImageURLLoaderWithAttribution.h"
  8. @implementation RCTImageURLLoaderRequest
  9. - (instancetype)initWithRequestId:(NSString *)requestId imageURL:(NSURL *)imageURL cancellationBlock:(RCTImageLoaderCancellationBlock)cancellationBlock
  10. {
  11. if (self = [super init]) {
  12. _requestId = requestId;
  13. _imageURL = imageURL;
  14. _cancellationBlock = cancellationBlock;
  15. }
  16. return self;
  17. }
  18. - (void)cancel
  19. {
  20. if (_cancellationBlock) {
  21. _cancellationBlock();
  22. }
  23. }
  24. @end