Observable which does not pass anything in onNext()

前端 未结 6 943
猫巷女王i
猫巷女王i 2021-02-02 06:52

I would need an Observable, for example to provide a system clock, which does not need to pass anything in onNext(). I couldn\'t find a signature that would allow me to do that.

6条回答
  •  别跟我提以往
    2021-02-02 07:15

    If you need something to be passed to onNext() before onCompleted() is called:

    Observable.just(null)
    

    If you only need onCompleted() to be called:

    Observable.empty()
    

提交回复
热议问题