slorber / react-async-hook

React hook to handle any async operation in React components, and prevent race conditions
https://sebastienlorber.com/handling-api-request-race-conditions-in-react
1.19k stars 45 forks source link

Use union for AsyncState type #83

Open adipascu opened 2 years ago

adipascu commented 2 years ago

This also removes the merge property and probably breaks this functionality

This is more of an idea than anything else, feel free to close this PR.

I'd like more guarantees over the type we are using to simplify the end TS code that uses this library.