Skip to content
New issue

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

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

Already on GitHub? # to your account

Request for a separate callback for onRefresh #6

Open
dietrich-stein opened this issue May 22, 2024 · 1 comment
Open

Request for a separate callback for onRefresh #6

dietrich-stein opened this issue May 22, 2024 · 1 comment

Comments

@dietrich-stein
Copy link

With onRequest as the only callback available for modifying state there is some difficulty in both updating the state and returning it. Would it not be preferred to decouple these concerns using a separate callback, (e.g. onRefresh) in order to manage the state asynchronously from the function that returns the state values to your component?

@caijf
Copy link
Owner

caijf commented May 23, 2024

Are there any scenarios where onRequest and onRefresh need to be distinguished?

If we want to get and set the status, wouldn't it be better to add the onStausChange and actionRef.current.setStatus properties?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants