Git Product home page Git Product logo

store2store's Introduction

About

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

# main build.gradle file
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' } # add this line
    }
}
# app/build.gradle file
compile 'com.github.playmoweb:store2store:3.0.0'

Create a store or use an existing one

You can create your own store implementing StoreService :

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

Contributors

Please see CONTRIBUTORS.md

store2store's People

Contributors

hoanghiephui avatar tspoke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

store2store's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.