• Stars
    star
    515
  • Rank 85,879 (Top 2 %)
  • Language
    Java
  • Created almost 8 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Bind observables to the lifecycle of Activity or Fragment in a non-invasive way.

RxLifecyle is a library that can help you to unsubscribe the observable sequences automatically when a activity or fragment is destroying. There are some differences between this library and trello/RxLifecycle:

  • This library will actually unsubscribe the sequence (See here). It means that the downstream observer will not receive onComplete(), onError()... anymore when the unsubscription occurs.

  • This library doesn't require you to inherit any activity or fragment. It will insert a non-gui fragment to your activity or fragment to listen the lifecycle events.

The simplest usage:

Observable.interval(0, 2, TimeUnit.SECONDS)
        // ...
        .compose(RxLifecycle.bind(this)
                .<Long>disposeObservableWhen(LifecycleEvent.DESTROY_VIEW))
        .subscribe();

In order to make sure the downstream will not continue to emit items, you need to put the compose(RxLifecycle.bind ..) at the bottom of the chain call. See the example for learning more usages.

To integrate this library to your project, you need to add the JitPack repository to build.gradle repositories firstly.

repositories {
    maven { url "https://jitpack.io" }
}

And then add library dependencies:

dependencies {
    compile 'com.github.nekocode.rxlifecycle:rxlifecycle:{lastest-version}'
    compile 'com.github.nekocode.rxlifecycle:rxlifecycle-compact:{lastest-version}' // Optional
}

This project is licensed under Apache 2.0. The lastest version of the library is Release.

More Repositories

1

Matisse

🎆 A well-designed local image and video selector for Android
Java
12,518
star
2

griffith

A React-based web video player
TypeScript
2,501
star
3

kids

Kids Is Data Stream
C++
1,225
star
4

rucene

Rust port of Lucene
Rust
1,005
star
5

cuBERT

Fast implementation of BERT inference directly on NVIDIA (CUDA, CUBLAS) and Intel MKL
C++
522
star
6

redis-shard

Redis sharding client library
Python
358
star
7

zhihu-rxjava-meetup

知乎 x RxJava Meetup
358
star
8

mirror

Yet another Sketch Mirror App for Android.
Java
272
star
9

SugarAdapter

Make RecyclerView.Adapter Great Again!
Java
235
star
10

zetta

Zetta Table Store
Go
130
star
11

norm

An orm library support nGQL for Golang
Go
103
star
12

tache

A tag based invalidation caching library
Python
77
star
13

promate

Graphite On VictoriaMetrics
Go
69
star
14

SERank

An efficient and effective learning to rank algorithm by mining information across ranking candidates. This repository contains the tensorflow implementation of SERank model. The code is developed based on TF-Ranking.
Python
50
star
15

cmdb

Programmable CMDB
Go
18
star
16

chaika

Elastic cache solution on Kubernetes
11
star
17

TLLM_QMM

TLLM_QMM strips the implementation of quantized kernels of Nvidia's TensorRT-LLM, removing NVInfer dependency and exposes ease of use Pytorch module. We modified the dequantation and weight preprocessing to align with popular quantization alogirthms such as AWQ and GPTQ, and combine them with new FP8 quantization.
C++
10
star
18

zetta-proto

Protobuf files for Zetta Table Store
Shell
7
star
19

presto-connectors

Presto Connectors project has been moved to TiBigData at PingCAP Incubator
6
star
20

zetta-client-go

Go client for Zetta Table Store
Go
4
star