lastItemsRequest: Property<ItemsRequest?> private let _lastItemsRequest = Variable<ItemsRequest?>(nil) let items: Property<[Item]> private let _items = Variable<[Item]>([]) let totalCount: Property<Int> private let _totalCount = Variable<Int>(0) let error: Property<Error?> private let _error = Variable<Error?>(nil) let hasNext: Property<Bool> private let _hasNext = Variable<Bool>(true) let searchAction: Action<ItemsRequest, ElementsResponse<Item>> private let perPage: Int = 20 let noResult: Observable<Bool> let reloadData: Observable<Void> let isFirstLoading: Observable<Bool> let keyboardWillShow: Observable<UIKeyboardInfo> let keyboardWillHide: Observable<UIKeyboardInfo> }
in return QiitaSession.shared.send(request) } let request = ItemsRequest(page: nextPage, perPage: perPage, query: nextQuery) searchAction.execute(request) searchAction.elements .subscribe(onNext: { items: ElementsResponse<Item> in // and so on }) .addDisposableTo(disposeBag) searchAction.errors searchAction.executing searchAction.enabled