test: drop RecursivePartial type

There is an existing type we can use instead.
This commit is contained in:
David Lechner
2022-03-11 15:42:42 -06:00
parent 93111b6af4
commit 7b08d8a7bf
+4 -8
View File
@@ -5,25 +5,21 @@ import { I18nContext, I18nManager } from '@shopify/react-i18n';
import { RenderResult, render } from '@testing-library/react';
import React, { ReactElement } from 'react';
import { Provider } from 'react-redux';
import { AnyAction, PreloadedState, createStore } from 'redux';
import { AnyAction, DeepPartial, PreloadedState, createStore } from 'redux';
import { END, MulticastChannel, Saga, Task, runSaga, stdChannel } from 'redux-saga';
import { RootState, rootReducer } from '../src/reducers';
import { RootSagaContext } from '../src/sagas';
type RecursivePartial<T> = {
[P in keyof T]?: RecursivePartial<T[P]>;
};
export class AsyncSaga {
private channel: MulticastChannel<AnyAction>;
private dispatches: (AnyAction | END)[];
private takers: { put: (action: AnyAction | END) => void }[];
private state: RecursivePartial<RootState>;
private state: DeepPartial<RootState>;
private task: Task;
public constructor(
saga: Saga,
state: RecursivePartial<RootState> = {},
state: DeepPartial<RootState> = {},
context?: Partial<RootSagaContext>,
) {
this.channel = stdChannel();
@@ -76,7 +72,7 @@ export class AsyncSaga {
return Promise.resolve(next);
}
public updateState(state: RecursivePartial<RootState>): void {
public updateState(state: DeepPartial<RootState>): void {
for (const key of Object.keys(state) as Array<keyof RootState>) {
// @ts-expect-error: writing to readonly for testing
this.state[key] = { ...this.state[key], ...state[key] };