display async messages coming from backend system
See original GitHub issueA often use case is to register/login users. Sometimes we need to display error messages like “Invalid Password” or something else, coming from a backend system. It would be nice, if i can use svelte-use-form
to display these errors too, maybe like this:
function submit() {
login(email, password)
.then(() => { // do something with the response })
.catch(e => {
if (e.message.includes("Invalid Password")) {
form.email.errorMap = "Wrong Password, please try again"
}
})
}
I don’t know to what extent it is possible to store error messages in the ErrorMap
that are not assigned to a validator. However, this error could then be displayed via this code dynamic:
Object.values($form.email.errors)[0]
I know the goal of this repo is to be easy to use. Nevertheless I would be happy if we could find a way to cover this use case.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Asynchronous Messaging, Part 4: Retrieve Results
So far in this series, we've covered how asynchronous messaging can be implemented with a durable queue and a backend service.
Read more >Asynchronous message-based communication - Microsoft Learn
When using messaging, processes communicate by exchanging messages asynchronously. A client makes a command or a request to a service by sending ...
Read more >Managing backend requests and frontend notifications ... - AWS
Many front-end applications pass requests for processing, wait for a result, and then display this to the user. This synchronous approach is ...
Read more >How To Handle Async Data Loading, Lazy Loading, and Code ...
React has a special component called Suspense that will display placeholders while the browser is loading your new component. In future versions ...
Read more >What are synchronous/asynchronous APIs? - TechTarget
The API may have to wait for a backend response. These APIs may provide a callback notification to the requester when the requested...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Haha yes I’ve worked with flutter but at the moment I’m kind of busy with work and soon I’ll also be starting my studies 😬 If anything changes I’ll get in touch
This is now supported in
2.3.0