(request: common.DownloadRequest)
| 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); |
nothing calls this directly
no test coverage detected