interface/logic/reducers: ts lint

This commit is contained in:
Matilde Park 2021-05-13 18:38:41 -04:00
parent a172a3c6d8
commit 3b74e46a10
3 changed files with 15 additions and 1 deletions

View File

@ -71,6 +71,7 @@ const addGraph = (json, state: GraphState): GraphState => {
const data = _.get(json, 'add-graph', false);
if (data) {
if (!('graphs' in state)) {
// @ts-ignore investigate zustand types
state.graphs = {};
}
@ -91,6 +92,7 @@ const removeGraph = (json, state: GraphState): GraphState => {
const data = _.get(json, 'remove-graph', false);
if (data) {
if (!('graphs' in state)) {
// @ts-ignore investigate zustand types
state.graphs = {};
}
const resource = data.ship + '/' + data.name;
@ -248,7 +250,7 @@ const removePosts = (json, state: GraphState): GraphState => {
} else {
const child = graph.get(index[0]);
if (child) {
return graph.set(index[0], produce((draft) => {
return graph.set(index[0], produce((draft: any) => {
draft.children = _remove(draft.children, index.slice(1));
}));
}

View File

@ -20,18 +20,26 @@ export const HarkReducer = (json: any) => {
const graphHookData = _.get(json, 'hark-graph-hook-update', false);
if (graphHookData) {
reduceState<HarkState, any>(useHarkState, graphHookData, [
// @ts-ignore investigate zustand types
graphInitial,
// @ts-ignore investigate zustand types
graphIgnore,
// @ts-ignore investigate zustand types
graphListen,
// @ts-ignore investigate zustand types
graphWatchSelf,
// @ts-ignore investigate zustand types
graphMentions
]);
}
const groupHookData = _.get(json, 'hark-group-hook-update', false);
if (groupHookData) {
reduceState<HarkState, any>(useHarkState, groupHookData, [
// @ts-ignore investigate zustand types
groupInitial,
// @ts-ignore investigate zustand types
groupListen,
// @ts-ignore investigate zustand types
groupIgnore
]);
}

View File

@ -20,6 +20,7 @@ export default class LaunchReducer {
const weatherData: WeatherState | boolean | Record<string, never> = _.get(json, 'weather', false);
if (weatherData) {
useLaunchState.getState().set((state) => {
// @ts-ignore investigate zustand types
state.weather = weatherData;
});
}
@ -27,6 +28,7 @@ export default class LaunchReducer {
const locationData = _.get(json, 'location', false);
if (locationData) {
useLaunchState.getState().set((state) => {
// @ts-ignore investigate zustand types
state.userLocation = locationData;
});
}
@ -34,6 +36,7 @@ export default class LaunchReducer {
const baseHash = _.get(json, 'baseHash', false);
if (baseHash) {
useLaunchState.getState().set((state) => {
// @ts-ignore investigate zustand types
state.baseHash = baseHash;
});
}
@ -41,6 +44,7 @@ export default class LaunchReducer {
const runtimeLag = _.get(json, 'runtimeLag', null);
if (runtimeLag !== null) {
useLaunchState.getState().set(state => {
// @ts-ignore investigate zustand types
state.runtimeLag = runtimeLag;
});
}