Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it work with HTTP Calls #34

Open
hasante opened this issue May 28, 2020 · 5 comments
Open

Make it work with HTTP Calls #34

hasante opened this issue May 28, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@hasante
Copy link

hasante commented May 28, 2020

You got me, but please add this feature it will go a long way

@klendi
Copy link
Owner

klendi commented May 29, 2020

what do you mean http calls ? You can "simulate" http calls, like start the bar on request beginning, and end it on result. You can even use redux

@hasante
Copy link
Author

hasante commented May 29, 2020

I have seen a react package like this that works with Redux to make HTTP calls possible.

I was thinking maybe you could do this for only react.js without the need to integrating Redux.
What are your taughts?

@klendi
Copy link
Owner

klendi commented May 29, 2020

Yeah but there are can multiple http calls, or 3 calls async, loading bar would go crazy, I don't think it's a good idea. It's more controllable or appropriate to only activate the bar when needed. It gives more control. And more popular bars don't have that. Bars are meant to have start -> end, the loading is just a simulation, we can't track http calls progress that much. Also you have project examples where I used the bar on my other projects.

@hasante
Copy link
Author

hasante commented May 29, 2020

Well, I am talking of user-initiated calls, but until you have tried looking into it and prioritizing a part of the scenario. I am not sure you can straightaway assume that has to be all you state up here.

This can serve as a start: https://github.com/aitboudad/ngx-loading-bar/blob/master/packages/http-client/README.md

React Redux version: https://github.com/mironov/react-redux-loading-bar

The importance from my perspective is there is a load of redundancy involved in importing your package everywhere you want to use it.

The problem here is that they integrate into the HTTP module of angular to make this possible. For my idea, I was thinking you can find a way around it. Say something creative as any calls after a component is loaded or something else.

I am sure there is a way, think about it, If it's not possible then you would have tried.

@klendi klendi added the enhancement New feature or request label Jul 21, 2020
@khooz
Copy link

khooz commented Jun 7, 2021

This is a specialization of a generic component IMHO. Since there are many 3rd party libraries for remote calls along the fairly new fetch, and in my case, I tend to use those 3rd party libraries still even when there's a native API in the standard, because, not all browsers still support it and using a polyfill is just the same as using a 3rd party lib without the extra oomph.

I think this is rather pointless in this state of browser market share, or at least as long as there are non deprecated browsers and browser versions that does not yet support native fetch API; especially in the enterprise environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants