Closed jurasans closed 4 years ago
Hi, I'm also looking for a possibilty to retry or reuse a promise. Maybe by resetting the state? Or is there a description anywhere how to initialize a new Promise with the function of a already rejected promise? Greetings
Found a workaround by looking in the code! You can initialize the Promise with an Action object. In this object you can define the used function. With this action object you can initialze multiple Promises with the same function code.
Example:
` Action<Action
// return calculated value
resolve(result);
}
catch(Exception ex)
{
reject(ex);
}
};
Promise
You cannot reset state of a promise. I don't think any promise implementation supports this. And for a good reason.
You have to create new promise each time. Exactly like you did.
hi,
feature request here : this library does not possess the ability to retry a promise. i would very much like to see that kind of functionality being added