Closed jduysen closed 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
- 2cfa0c3 https://github.com/coopermaruyama/tableau-react/pull/36/commits/2cfa0c3e12b379a9415dd8067be2196d0980be34 :clock: Added interval functionality - can pass interval in the options object as milliseconds
- 864b122 https://github.com/coopermaruyama/tableau-react/pull/36/commits/864b122a500115fc2dc360617d1df3c376467fed :bulb: Added inteval support to options object and updated readme
- b2bb851 https://github.com/coopermaruyama/tableau-react/pull/36/commits/b2bb851d2da3e8432944d1be2eeee244877fa3f9 built dist
File Changes
(3 files https://github.com/coopermaruyama/tableau-react/pull/36/files)
- M README.md https://github.com/coopermaruyama/tableau-react/pull/36/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5 (1)
- M dist/TableauReport.js https://github.com/coopermaruyama/tableau-react/pull/36/files#diff-2dec10dcfa30c946feb710efc38d9dd0093807b375444ee1bdb2196cbd24a307 (45)
- M src/TableauReport.jsx https://github.com/coopermaruyama/tableau-react/pull/36/files#diff-d344b34c35826f414dcbf4c2ca4d27700dec8453a8f74ac50a46c41a36f9b922 (18)
Patch Links:
- https://github.com/coopermaruyama/tableau-react/pull/36.patch
- https://github.com/coopermaruyama/tableau-react/pull/36.diff
— 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 .
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