You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/core/image-cache.md
+12-17Lines changed: 12 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,10 @@
2
2
title: ImageCache
3
3
contributors:
4
4
- Ombuweb
5
+
- NathanWalker
5
6
---
6
7
7
-
ImageCache allows you to cache an image from an HTTP request.
8
+
ImageCache allows you to cache an image from an HTTP request. You can alternatively use a plugin that auto handles image caching like [`@triniwiz/nativescript-image-cache-it`](https://www.npmjs.com/package/@triniwiz/nativescript-image-cache-it).
8
9
9
10
## Using ImageCache
10
11
@@ -13,21 +14,15 @@ For consistency, you should use a single ImageCache instance throughout your app
13
14
```ts
14
15
import { ImageCache } from'@nativescript/core'
15
16
16
-
exportclassHelloWorldModelextendsObservable {
17
-
imageCache =newImageCache()
18
-
19
-
constructor() {
20
-
super()
21
-
}
22
-
}
17
+
const imageCache =newImageCache()
23
18
```
24
19
25
20
### Save an image to cache
26
21
27
22
To retrieve an image from a remote server and cache it, use either the [push](#push) or [enqueue](#enqueue) method. These methods cache the `android.graphics.Bitmap` (Android) or `UIImage` (iOS) instance.
0 commit comments