From 5f630f30f47d52f7cccab3ed20dd003540525b67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Wed, 9 Nov 2016 15:54:42 +0000 Subject: [PATCH] navigate to the right --- spikes/graphs-matrix/chartjs/client/actions.js | 6 +++--- spikes/graphs-matrix/chartjs/package.json | 2 +- spikes/graphs-matrix/chartjs/server/metric.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spikes/graphs-matrix/chartjs/client/actions.js b/spikes/graphs-matrix/chartjs/client/actions.js index 52f0c0b7..d48d610c 100644 --- a/spikes/graphs-matrix/chartjs/client/actions.js +++ b/spikes/graphs-matrix/chartjs/client/actions.js @@ -1,12 +1,12 @@ -const takeRight = require('lodash.takeright'); +const take = require('lodash.take'); const actions = { 'UPDATE_STATS': (state, action) => { - const data = (state[action.subscription] || []).concat([action.payload]); + const data = [action.payload].concat(state[action.subscription] || []); return { ...state, - [action.subscription]: takeRight(data, state.windowSize) + [action.subscription]: take(data, state.windowSize) }; } }; diff --git a/spikes/graphs-matrix/chartjs/package.json b/spikes/graphs-matrix/chartjs/package.json index 8573286a..65122fd3 100644 --- a/spikes/graphs-matrix/chartjs/package.json +++ b/spikes/graphs-matrix/chartjs/package.json @@ -24,7 +24,7 @@ "hapi": "^15.2.0", "hapi-webpack-dev-plugin": "^1.1.4", "inert": "^4.0.2", - "lodash.takeright": "^4.1.1", + "lodash.take": "^4.1.1", "nes": "^6.3.1", "postcss-loader": "^1.0.0", "postcss-modules-values": "^1.2.2", diff --git a/spikes/graphs-matrix/chartjs/server/metric.js b/spikes/graphs-matrix/chartjs/server/metric.js index 62ef4a8e..24015f70 100644 --- a/spikes/graphs-matrix/chartjs/server/metric.js +++ b/spikes/graphs-matrix/chartjs/server/metric.js @@ -19,7 +19,7 @@ module.exports = (server) => ({ when: new Date().getTime(), cpu: Math.random() * 100 }); - }, 32); + }, 100); cdm[id] = { interval,