You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello Team,
usePromiseTracker hook provides only status about whether promise is in progress or not but we dont get to know if promise is resolved or rejected, I request to add one more feature to returned status of promise whether it is resolved or rejected or simple return array of promises that are tracked in that specific area. Is it possible to add this feature ?
The text was updated successfully, but these errors were encountered:
Hello @Tanmay2711 the initial goal of react promise tracker was just to tell you if something was going on or not, we have planned to release a version that returns you a counter with the number of promises going on so far.
Your idea sounds interesting, but not sure which approach to follow to implement it, we could keep a stack of promises:
You could access it via some param in the hook.
How would it be worth for you? (track promise is global, and promises could belong to other places).
How long should we store that promise results?
What about identifying them?
Not sure if it would be better to make some error checking per promise or use some interceptor.
Hello @brauliodiez . Thanks for you reply. I really like react-promise-tracker, it helped me to resolve errors in my app due to manual state management. Though I came across scenario where I want to know promise I am tracking is resolved or rejected. I am using area based approach in my app. By passing specific area to trackPromise and usePromiseTracker hook. Suppose I am tracking one promise at specific area value, then usePromiseTracker hook should provide me information whether promise is resolved or rejected, it can be array of promise objects/ custom objects returned by the hook for the area that is passed and I can track multiple promises on same area.
hook should provide this information during the time span between promise started and completed as resolved or rejected,
for e.g.
const { promiseInProgress : True | False, promises : [{id:'promise1',status:resolved}, {id:'promise2',status:rejected}]} = usePromiseTracker({area:'MY AREA'});
It will be great help , if we can get information about promise's status whether it is resolved or rejected.
Hello Team,
usePromiseTracker hook provides only status about whether promise is in progress or not but we dont get to know if promise is resolved or rejected, I request to add one more feature to returned status of promise whether it is resolved or rejected or simple return array of promises that are tracked in that specific area. Is it possible to add this feature ?
The text was updated successfully, but these errors were encountered: