Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GithubPaginatedSearch example bug #46

Closed
SylvanasX opened this issue Feb 9, 2019 · 0 comments
Closed

GithubPaginatedSearch example bug #46

SylvanasX opened this issue Feb 9, 2019 · 0 comments

Comments

@SylvanasX
Copy link
Contributor

IMAGE ALT TEXT HERE

Reproduce Step:

Step 1:

Input the search text swift(request success)

Step 2:

TableView scroll near bottom. Lost network or the next page request failure. Lead response failure.

Execute case .response(.failure(let error))

case .response(.failure(let error)):
    var result = state
    result.shouldLoadNextPage = false
    result.lastError = error
    return result
}

Then the state emit flatMapLatest execute. shouldLoadNextPage current is false. Because current TableView near the bottom. Event.scrollingNearBottom emit again.

So requst next page again. if request next page failure again. The Feedback Repeat execution. Can not stop.

let triggerLoadNextPage: (Driver<State>) -> Signal<Event> = { state in
            return state.flatMapLatest { state -> Signal<Event> in
                if state.shouldLoadNextPage {
                    return Signal.empty()
                }
                
                return searchResults.rx.nearBottom.map { _ in Event.scrollingNearBottom }
                .debug()
            }
        }
SylvanasX added a commit to SylvanasX/RxFeedback.swift that referenced this issue Feb 9, 2019
@SylvanasX SylvanasX mentioned this issue Feb 9, 2019
kzaher pushed a commit that referenced this issue Feb 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant