Sometimes to show an error or success dialog we need to fetch additional data, for example, when the api i want to fetch data from returns an error code and i need to fetch the text of the error code before showing it.
example:
toast.promise(somePromise, {
loading: "Saving data:...",
success: "Data saved!",
error: async (e) => `There was an error: ${await getErrorMessage(e)}`
})
Sometimes to show an error or success dialog we need to fetch additional data, for example, when the api i want to fetch data from returns an error code and i need to fetch the text of the error code before showing it. example: