1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/packages/unleash-frontend/public/js/stores/initalizer.js

19 lines
511 B
JavaScript
Raw Normal View History

2016-06-18 21:53:18 +02:00
'use strict';
const FeatureToggleActions = require('./FeatureToggleActions');
const StrategyActions = require('./StrategyActions');
const Timer = require('../utils/Timer');
2015-03-17 22:52:10 +01:00
2016-06-18 21:53:18 +02:00
let _timer;
2015-03-17 22:52:10 +01:00
2016-07-02 11:54:50 +02:00
function load () {
2015-03-17 22:52:10 +01:00
FeatureToggleActions.init.triggerPromise();
StrategyActions.init.triggerPromise();
FeatureToggleActions.initArchive.triggerPromise();
}
2016-07-02 11:54:50 +02:00
module.exports = function (pollInterval) {
2016-06-18 21:53:18 +02:00
const intervall = pollInterval || 30;
2016-07-02 11:54:50 +02:00
_timer = new Timer(load, intervall * 1000);
2015-03-17 22:52:10 +01:00
_timer.start();
};