Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ACS
Public
VILLASframework
VILLASweb
Commits
dd1c5ddf
Commit
dd1c5ddf
authored
Nov 27, 2018
by
Steffen Vogel
🎅🏼
Browse files
periodically refresh simulator states
parent
9efdd2f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/containers/simulators.js
View file @
dd1c5ddf
...
...
@@ -89,6 +89,20 @@ class Simulators extends Component {
type
:
'
simulators/start-load
'
,
token
:
this
.
state
.
sessionToken
});
// Start timer for periodic refresh
this
.
timer
=
window
.
setInterval
(()
=>
this
.
refresh
(),
1000
);
}
componentWillUnmount
()
{
window
.
clearInterval
(
this
.
timer
);
}
refresh
()
{
AppDispatcher
.
dispatch
({
type
:
'
simulators/start-load
'
,
token
:
this
.
state
.
sessionToken
});
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment