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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for dynamic URL #3

Closed
ajaleelp opened this issue Apr 5, 2019 · 5 comments
Closed

Support for dynamic URL #3

ajaleelp opened this issue Apr 5, 2019 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@ajaleelp
Copy link

ajaleelp commented Apr 5, 2019

Thanks for the handy component @vivek12345 馃憤
I was wondering if there is anyway to modify the url on each poll - say /resource/1, /resource/2 etc. From what I could gather, this is not possible as of now?

@vivek12345
Copy link
Owner

Thanks @ajaleelp and yes you are right, as of now we do not support changing the url on a success or a failure event.

May I know more about your use case here so that I can think about implementing this if it's a use-case that everyone needs?

@ajaleelp
Copy link
Author

ajaleelp commented Apr 5, 2019

I was trying to implement a psuedo-live feed by polling for a resource with id above the latest I have. Got it working with a setInterval and fetch combination for now. But yeah, I guess it would be a nice addition for your work.

@vivek12345
Copy link
Owner

@ajaleelp Would you like to give this a try. Implementing dynamic url behaviour.

@vivek12345
Copy link
Owner

Hey @ajaleelp, apologies for the delay. The last couple of months have been really hectic in terms of work.
But I am hoping latest release v1.0.7 will address all your concerns.
Thank you for creating this issue and I hope the new release is helpful.

Please try it and let me know if it fixes your issue.

Here is the sandbox link which will demonstrate an example which is similar to your requirements

https://codesandbox.io/s/react-polling-custom-promise-dynamic-url-3z7h2?file=/src/App.js

@vivek12345 vivek12345 added the enhancement New feature or request label Jun 23, 2020
@vivek12345 vivek12345 self-assigned this Jun 23, 2020
@ajaleelp
Copy link
Author

@vivek12345 Thank you for taking the time and getting this done 馃檪 Unfortunately, it's been a while since I touched the project where I was using this. Will let you know if I ever get back to it. Cheers!

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

2 participants