Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tspoke committed Sep 13, 2017
1 parent 18aadd2 commit 95a84f0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 14 deletions.
9 changes: 1 addition & 8 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,4 @@ In contributing order

* Author and maintainer
* Most features development


* **[Hoang Hiep](https://github.com/hoanghiephui)**

* Port the library to RxJava2




38 changes: 32 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
## About

Store2Store simplify the synchronization between storages.
Store2Store simplify the synchronization between Store of datas.
For instance, you can easily synchronize a REST API with a local Realm datastore.

**This is the rxJava2 implementation.**

*If you want to use a rxJava1 version, please use the 1.x.x tags (API is different).*


## Installation with gradle

```
Expand All @@ -17,21 +22,42 @@ allprojects {

```
# app/build.gradle file
compile 'com.github.playmoweb:store2store:<TAG>'
compile 'com.github.playmoweb:store2store:3.0.0'
```


## Create a store or use an existing one

You can create your own store implementing AbstractService :
You can create your own store implementing StoreService :

```java
public class MyStoreService<T> extends AbstractService<T> {
...
public class MyStore<T> extends StoreService<T> {
public MyStore(Class<T> clazz) {
super(clazz, new MyStoreDao());
}

// internal class for the DAO
private class MyStoreDao extends StoreDao<T> {
// implements all methods of the abstract class you can need (some methods needs other to work)
}
}
```

## Sync your store to another one

```
public class MyConcreteModelStore extends MyStore<MyModel> {
public MyConcreteModelStore(){
super(MyModel.class);
this.syncWith(new MemoryStore()); // eg: sync with a newly created memoryStore
// you can inject a store with dagger and syncWith() here too :)
}
// Here you just have to implements the methods you need
}
```

### Existing implementations
## Existing implementations

- Realm : https://github.com/playmoweb/store2realm

Expand Down

0 comments on commit 95a84f0

Please sign in to comment.