Relative Content

Tag Archive for rustpostcallbackwasm-bindgenyew

How to refresh a list from GET endpoint after POST request in Rust Yew

The backend on localhost:3040/todos accepts GET and POST requests. In the frontend there is a form with an input field and the submit button to send POST. Underneath the form is the list retrieved by GET. A refresh flag flips when a new POST is sent and triggers use_effect_with with the GET call. The problem is that the GET request is usually faster than POST and I am struggling to find a way to stall the refresh until the POST is processed in the backend.