MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / _downloadCore

Method _downloadCore

packages/core/ui/image-cache/index.ios.ts:60–78  ·  view source on GitHub ↗
(request: common.DownloadRequest)

Source from the content-addressed store, hash-verified

58 }
59
60 public _downloadCore(request: common.DownloadRequest) {
61 httpRequest({ url: request.url, method: 'GET' }).then(
62 (response) => {
63 try {
64 const image = UIImage.alloc().initWithData(response.content.raw);
65 if (image) {
66 this._onDownloadCompleted(request.key, image);
67 } else {
68 this._onDownloadError(request.key, new Error('No result for provided url'));
69 }
70 } catch (err) {
71 this._onDownloadError(request.key, err);
72 }
73 },
74 (err) => {
75 this._onDownloadError(request.key, err);
76 },
77 );
78 }
79
80 public get(key: string): any {
81 return this._cache.objectForKey(key);

Callers

nothing calls this directly

Calls 2

_onDownloadCompletedMethod · 0.95
_onDownloadErrorMethod · 0.95

Tested by

no test coverage detected