Observable < List < ChatConversationBase > > loadAllConversations ( ) { return Observable . create ( emitter -> storeFactory . execute ( new StoreTransaction < ChatStore > ( ) { @ Override protected void execute ( ChatStore store ) { store . open ( ) ; List < ChatConversationBase > conversations = store . getAllConversations ( ) ; store . close ( ) ; emitter . onNext ( conversations ) ; emitter . onCompleted ( ) ; } } ) , Emitter . BackpressureMode . LATEST ) ; }
Wraps loading all conversations from store implementation into an Observable .