Skip to content
/ rxstate Public

This project is implementation of ideas from "Managing state reactive way" article.

License

Notifications You must be signed in to change notification settings

konmik/rxstate

Repository files navigation

RxState

This project is implementation of ideas from Managing state reactive way article.

RxJava1 dependency

Maven Central

dependencies {
    compile 'com.konmik.rxstate:rxstate1:0.1.0-beta1'
}
RxJava2 dependency

Maven Central

dependencies {
    compile 'com.konmik.rxstate:rxstate2:0.1.0-beta1'
}

Usage

Code (RxJava1):

    RxState<Integer> state = new RxState<>(0, Schedulers.immediate());
    state.values(StartWith.SCHEDULE)
            .subscribe(it -> System.out.println(it));
    state.apply(it -> it + 1);

Code (RxJava2):

    RxState<Integer> state = new RxState<>(0, Schedulers.single());
    state.values(StartWith.SCHEDULE)
            .subscribe(it -> System.out.println(it));
    state.apply(it -> it + 1);

Prints:

0
1

About

This project is implementation of ideas from "Managing state reactive way" article.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages