openreplay/frontend/app/player/MessageDistributor/Lists.ts
Alex K c3fcda45d4
Devtools separation (#752)
* feat (backend+frontend/player): writing  devtools-related messages into a separate file
2022-10-07 16:20:48 +02:00

23 lines
644 B
TypeScript

import type { Message } from './messages'
import ListWalker from './managers/ListWalker';
export const LIST_NAMES = ["redux", "mobx", "vuex", "zustand", "ngrx", "graphql", "exceptions", "profiles"] as const;
export const INITIAL_STATE = {}
LIST_NAMES.forEach(name => {
INITIAL_STATE[`${name}ListNow`] = []
INITIAL_STATE[`${name}List`] = []
})
type ListsObject = {
[key in typeof LIST_NAMES[number]]: ListWalker<any>
}
export function initLists(): ListsObject {
const lists: Partial<ListsObject> = {};
for (var i = 0; i < LIST_NAMES.length; i++) {
lists[LIST_NAMES[i]] = new ListWalker();
}
return lists as ListsObject;
}