useNetFlux
A powerful network composable & light-weight API playground
Inception
While working on one a project; I came accross a problem where we had tabs to change the UI; and whenever you'd click on a tab, it would make a new network request to fetch and show new data of that respective tab. Now, if you do it slow enough, it would switch the tab and show a preloader while it fetched the data from the API.
But the problem arose if you click tabs quickly, and switched between them fast-enough. This lead to each click triggering an API call; and when the user finally stopped switching between the tabs - it lead to completion of each request one by one - which in turn lead to the data in the UI getting updated in sequence as each API request was resolving a successful response.
This was obviously bad user experience, but more than that - it was bad handling of APIs itself. I wanted an architecture which would allow me to abort/cancel the previous on going API request and instead make a new, updated API request.
I started exploring what solutions I have available and, sure I could implement a simple solution to this to handle my APIs properly I realized that there is no API controller or package that would provide me with any control over my requests. Hence, useNetFlux was born.
A detailed documentation and & list of features will be published soon, I am working on it.