1
0
mirror of https://github.com/yldio/copilot.git synced 2024-12-01 07:30:07 +02:00

navigate to the right

This commit is contained in:
Sérgio Ramos 2016-11-09 15:54:42 +00:00
parent e50b68b6ee
commit 5f630f30f4
3 changed files with 5 additions and 5 deletions

View File

@ -1,12 +1,12 @@
const takeRight = require('lodash.takeright'); const take = require('lodash.take');
const actions = { const actions = {
'UPDATE_STATS': (state, action) => { 'UPDATE_STATS': (state, action) => {
const data = (state[action.subscription] || []).concat([action.payload]); const data = [action.payload].concat(state[action.subscription] || []);
return { return {
...state, ...state,
[action.subscription]: takeRight(data, state.windowSize) [action.subscription]: take(data, state.windowSize)
}; };
} }
}; };

View File

@ -24,7 +24,7 @@
"hapi": "^15.2.0", "hapi": "^15.2.0",
"hapi-webpack-dev-plugin": "^1.1.4", "hapi-webpack-dev-plugin": "^1.1.4",
"inert": "^4.0.2", "inert": "^4.0.2",
"lodash.takeright": "^4.1.1", "lodash.take": "^4.1.1",
"nes": "^6.3.1", "nes": "^6.3.1",
"postcss-loader": "^1.0.0", "postcss-loader": "^1.0.0",
"postcss-modules-values": "^1.2.2", "postcss-modules-values": "^1.2.2",

View File

@ -19,7 +19,7 @@ module.exports = (server) => ({
when: new Date().getTime(), when: new Date().getTime(),
cpu: Math.random() * 100 cpu: Math.random() * 100
}); });
}, 32); }, 100);
cdm[id] = { cdm[id] = {
interval, interval,