M
M
mrrangerr2020-03-10 20:00:35
Python
mrrangerr, 2020-03-10 20:00:35

How to load data when scrolling all the way down?

Hello! I have a middleware that sends a photo request (below)

function getPhotos() {
    return dispatch => {
        dispatch(getPhotosBegin());
        return unsplash.photos.listPhotos(1, 15, "latest")  //Первый параметр -  страница, второй количество элементов на странице
            .then(toJson)
            .then(json => {
                dispatch(getPhotosSuccess(json));
            })
            .catch(error => dispatch(getPhotosFailure(error)));
    };
}

The task is to send a new request when the user has scrolled all the way down, show him the next batch of photos. I can't figure out how to do this, please help

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
Roman Kitaev, 2019-08-01
@deliro

There is no python error here. This is your personal mistake. Accept it and once again, with pain in your soul, study at least one page of a python textbook, where they talk about syntax

T
tsarevfs, 2019-08-01
@tsarevfs

Quotes inside quotes. Use different quotes inside and outside:"text'quoted'text"

A
Arseny, 2020-03-10
@mrrangerr

intersectionObserver or catch the position of the "trigger" object relative to the viewport.
The first one does not have support in IE, well, and it doesn’t matter, but there is a polyfill.

F
frontend queen, 2020-03-10
@arka33

fit ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question