coopermaruyama / tableau-react

Tableau React component integrated with Tableau JS API.
MIT License
77 stars 60 forks source link

Added refresh Interval functionality #36

Closed jduysen closed 2 years ago

jduysen commented 2 years ago

Hey,

I added logic to the componentDidMount method to handle an interval in the options object. If the dev passes a key/value of "interval": 5000 (just needs to be the desired interval in milliseconds)in the options object, the refreshDataAsync() method will get called every 5 seconds. Behavior should be unchanged if they don't pass an interval. I added a piece of state to keep track of the intervalID so that on component unmount it clears the interval and stops calling refreshDataAsync()

Let me know if you have any questions. It would be awesome if this feature could be added to the library.

Thanks,

James

coopermaruyama commented 2 years ago

Thanks for this. I will test this as soon as I can and merge if it looks good.

On Wed, Nov 24, 2021 at 4:58 PM jduysen @.***> wrote:

Hey,

I added logic to the componentDidMount method to handle an interval in the options object. If the dev passes a key/value of "interval": 5000 (just needs to be the desired interval in milliseconds)in the options object, the refreshDataAsync() method will get called every 5 seconds. Behavior should be unchanged if they don't pass an interval. I added a piece of state to keep track of the intervalID so that on component unmount it clears the interval and stops calling refreshDataAsync()

Let me know if you have any questions. It would be awesome if this feature could be added to the library.

Thanks,

James

You can view, comment on, or merge this pull request online at:

https://github.com/coopermaruyama/tableau-react/pull/36 Commit Summary

File Changes

(3 files https://github.com/coopermaruyama/tableau-react/pull/36/files)

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/coopermaruyama/tableau-react/pull/36, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKDV2QWWLQWZTDRLYWWHJDUNWC23ANCNFSM5IXKNZRQ .