M
M
Maria_Gavrilova2020-05-05 13:02:00
React
Maria_Gavrilova, 2020-05-05 13:02:00

API requests in React?

Hello. I am developing an admin panel application. There is a user page. The structure of the module is something like this:

src
    -containers
        -UsersPage
            -components
                -UsersList
                -UserForm


The project uses redux. The question is, should I store users in the store and query the server using sagas? Do they do this in large projects?

But why not just place all API requests in the root UsersPage container? For unification in the project, you need to adopt a single policy? Either requests in the root container or redux-saga. Tell me how best to do for scalability?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Alexandrovich, 2020-05-05
@Maria_Gavrilova

I think that requests should be made using sagas because at some point you will need to make the same request but in a different place and you will need to sort out all the requests in the correct sequence, etc. And you will have to rewrite the query as it should be in sagas. And if you have already started using the technology, then use it throughout the project and not in parts.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question