Skip to content

Commit 15c070a

Browse files
author
crypticminds
authored
Update README.md
1 parent 858de73 commit 15c070a

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
- Create an application class and initialize the cache in the onCreate() method.
3232

33+
```kotlin
3334
import android.app.Application
3435
import com.arcane.coldstoragecache.cache.Cache
3536

@@ -41,10 +42,11 @@
4142
}
4243

4344
}
45+
```
4446

4547
- Register your application in the android manifest file by providing the **android:name** attribute
4648

47-
```
49+
```xml
4850
<application
4951
android:allowBackup="true"
5052
android:icon="@mipmap/ic_launcher"
@@ -59,6 +61,17 @@
5961
## @Refrigerate Annotation
6062
Annotate your functions using this to keep the output of the function in the cache for a given set of inputs .
6163

64+
### For releases > 2.1.0
65+
66+
Now you can use @CacheKey annotation to declare parameters as the keys of the cache
67+
68+
```kotlin
69+
@Refrigerate(timeToLive : 2000, operation = "cacheImage")
70+
fun downloadImage(@CacheKey url : String , @CacheKey someOtherVariable : String , variableThatIsNotAKey : String) : Bitmap {
71+
.....
72+
}
73+
```
74+
6275
Usage:-
6376

6477
```kotlin

0 commit comments

Comments
 (0)