From 4198615c4b902d3338ec8f533807338339872e0d Mon Sep 17 00:00:00 2001 From: z-chu Date: Thu, 1 Jun 2017 23:23:02 +0800 Subject: [PATCH] update README.md --- README.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index fa8c622..5dd5537 100644 --- a/README.md +++ b/README.md @@ -32,13 +32,13 @@ * **RxJava 2.0** ```groovy dependencies { - compile 'com.zchu:rxcache:2.0.1' + compile 'com.zchu:rxcache:2.0.2' } ``` * **RxJava 1.0** ```groovy dependencies { - compile 'com.zchu:rxcache:1.2.1' + compile 'com.zchu:rxcache:1.2.3' } ``` @@ -62,7 +62,7 @@ rxCache = new RxCache.Builder() 调用示例: ```java gankApi.getHistoryGank(1) - .compose(rxCache.transformer("custom_key", strategy)) + .compose(rxCache.transformer("custom_key", GankBean.class,strategy)) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Subscriber>() { @@ -88,6 +88,17 @@ gankApi.getHistoryGank(1) }); ``` - +泛型: +```java + gankApi.getHistoryGank(1) + .map(new Function>() { + @Override + public List apply(@NonNull GankBean gankBean) throws Exception { + return gankBean.getResults(); + } + }) + .compose(rxCache.>transformer("custom_key", new TypeToken>() {}.getType(), strategy)) + ... +```