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

Add auto-refresh support #38

Closed
qiangwang opened this issue Apr 30, 2013 · 2 comments
Closed

Add auto-refresh support #38

qiangwang opened this issue Apr 30, 2013 · 2 comments
Milestone

Comments

@qiangwang
Copy link

In many websites there are always some html blocks that load in ajax way to increase site load speed.

And some html blocks need refreshing periodically.

So auto-refresh support may help a lot.

@paltman
Copy link
Contributor

paltman commented Jul 13, 2013

@qiangwang Interesting idea. let me think on this some more.

@paltman
Copy link
Contributor

paltman commented Jul 13, 2013

Considering doing something like adding a new core feature to setup intervals/timeouts:

<div data-delay="0" data-url="..." [data-method="post"]>
<div data-interval="5" data-url="..." [data-method="post"]>

One would setup a timeout and process much the same way as a form submit or link click even sending the same events upon completion of the ajax request so all the same handler attributes would apply. The other would be the same but allow you to set an interval that repeats.

This would enable you to combine different handles to do things like prepend to a list every 30 seconds, auto-refresh myself every 3 seconds, populate myself on load, etc.

I am pretty sure this covers just about every use case I can imagine.

I haven't decided yet if i'll add a new event in addition to eldarion-ajax:success, in place of it, or pass an extra parameter to the success event so that the handler can know if it's the result of a interval or not. I am inclined to not so as to avoid the coupling.

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

No branches or pull requests

2 participants