Skip to content

Commit

Permalink
Fix rtk-query-monitor build
Browse files Browse the repository at this point in the history
  • Loading branch information
Methuselah96 committed Dec 25, 2023
1 parent 9ec0e9f commit 188db54
Showing 1 changed file with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { PureComponent, createRef, ReactNode } from 'react';
import type { AnyAction, Dispatch, Action } from '@reduxjs/toolkit';
import type { Dispatch, Action } from '@reduxjs/toolkit';
import type { LiftedAction, LiftedState } from '@redux-devtools/core';
import {
QueryFormValues,
Expand Down Expand Up @@ -96,15 +96,33 @@ class RtkQueryInspector<S, A extends Action<string>> extends PureComponent<
}

handleQueryFormValuesChange = (values: Partial<QueryFormValues>): void => {
this.props.dispatch(changeQueryFormValues(values) as AnyAction);
this.props.dispatch(
changeQueryFormValues(values) as unknown as LiftedAction<
S,
A,
RtkQueryMonitorState
>,
);
};

handleSelectQuery = (queryInfo: RtkResourceInfo): void => {
this.props.dispatch(selectQueryKey(queryInfo) as AnyAction);
this.props.dispatch(
selectQueryKey(queryInfo) as unknown as LiftedAction<
S,
A,
RtkQueryMonitorState
>,
);
};

handleTabChange = (tab: QueryPreviewTabs): void => {
this.props.dispatch(selectedPreviewTab(tab) as AnyAction);
this.props.dispatch(
selectedPreviewTab(tab) as unknown as LiftedAction<
S,
A,
RtkQueryMonitorState
>,
);
};

render(): ReactNode {
Expand Down

0 comments on commit 188db54

Please sign in to comment.