mirror of
https://github.com/urbit/shrub.git
synced 2024-12-24 03:14:30 +03:00
interface/logic/reducers: ts lint
This commit is contained in:
parent
a172a3c6d8
commit
3b74e46a10
@ -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));
|
||||
}));
|
||||
}
|
||||
|
@ -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
|
||||
]);
|
||||
}
|
||||
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user