/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v6.2.4
shared/engine/stats.tsx
29 строк
553 B
chrisnojima
Make tsc-strict pass again (#18881)
13 авг 2019, 00:12
Не верифицирован
13 авг 2019, 00:12
dc4e22f
Код
Авторство
О чём код?
// RPC stats. Not keeping this in redux so we don't get any thrashing const _stats: { eof: number in: {[method: string]: {count: number}} out: {[method: string]: {count: number}} } = { eof: 0, in: {}, out: {}, } export const gotStat = (method: string, incoming: boolean) => { const inKey = incoming ? 'in' : 'out' if (!_stats[inKey][method]) { _stats[inKey][method] = { count: 0, } } const i = _stats[inKey][method] i.count++ } export const gotEOF = () => { ++_stats.eof } export const getStats = () => _stats