mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
wip
This commit is contained in:
23
client/app/scripts/utils/demo-utils.js
Normal file
23
client/app/scripts/utils/demo-utils.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import _ from 'lodash';
|
||||
import { clickNode } from '../actions/app-actions';
|
||||
|
||||
const INTERVAL = 3000;
|
||||
|
||||
function openNodeDetails(getState, dispatch) {
|
||||
const action = clickNode();
|
||||
if (typeof action === 'function') {
|
||||
return action(dispatch, getState);
|
||||
}
|
||||
|
||||
return dispatch(action);
|
||||
}
|
||||
|
||||
const actions = [openNodeDetails];
|
||||
|
||||
export default function runDemo(getState) {
|
||||
setInterval(() => {
|
||||
const state = getState().toJS();
|
||||
const fn = _.sample(actions);
|
||||
|
||||
}, INTERVAL);
|
||||
}
|
||||
Reference in New Issue
Block a user