Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try using ACR[T] over {} within ValidateSliceCaseReducers #3097

Conversation

Andarist
Copy link

I just want to check out what CI has to say about this change.

@codesandbox
Copy link

codesandbox bot commented Jan 17, 2023

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify
Copy link

netlify bot commented Jan 17, 2023

Deploy Preview for redux-starter-kit-docs ready!

Name Link
🔨 Latest commit 5868f77
🔍 Latest deploy log https://app.netlify.com/sites/redux-starter-kit-docs/deploys/63c6e8475d06930009b651e8
😎 Deploy Preview https://deploy-preview-3097--redux-starter-kit-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5868f77:

Sandbox Source
Vanilla Configuration
Vanilla Typescript Configuration
rsk-github-issues-example Configuration
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration

@Andarist
Copy link
Author

Posting the CI failure logs here for posterity, since GitHub doesn't store them forever:

Error: src/tests/createSlice.typetest.ts(435,7): error TS2322: Type '{ start(state: any): void; success(state: GenericState<T>, action: { payload: T; type: string; }): void; } & Reducers & { [T in keyof Reducers]: Reducers[T] extends { ...; } ? { ...; } : Reducers[T]; }' is not assignable to type 'ValidateSliceCaseReducers<GenericState<T>, { [x: string]: ...; start: unknown; success: unknown; }>'.
  Type '{ start(state: any): void; success(state: GenericState<T>, action: { payload: T; type: string; }): void; } & Reducers & { [T in keyof Reducers]: Reducers[T] extends { ...; } ? { ...; } : Reducers[T]; }' is not assignable to type '{ [x: string]: (CaseReducer<GenericState<T>, { payload: any; type: string; }> | CaseReducerWithPrepare<GenericState<T>, PayloadAction<any, string, any, any>>) & (Reducers[string] extends { ...; } ? { ...; } : Reducers[string]) extends { ...; } ? { ...; } : (CaseReducer<...> | CaseReducerWithPrepare<...>) & (Reducers...'.
    'string' index signatures are incompatible.
      Type '(CaseReducer<GenericState<T>, { payload: any; type: string; }> | CaseReducerWithPrepare<GenericState<T>, PayloadAction<any, string, any, any>>) & (Reducers[string] extends { ...; } ? { ...; } : Reducers[string])' is not assignable to type '(CaseReducer<GenericState<T>, { payload: any; type: string; }> | CaseReducerWithPrepare<GenericState<T>, PayloadAction<any, string, any, any>>) & (Reducers[string] extends { ...; } ? { ...; } : Reducers[string]) extends { ...; } ? { ...; } : (CaseReducer<...> | CaseReducerWithPrepare<...>) & (Reducers[string] extend...'.
        Type 'CaseReducer<GenericState<T>, { payload: any; type: string; }> & (Reducers[string] extends { reducer(s: GenericState<T>, action?: infer A | undefined): any; } ? { ...; } : Reducers[string])' is not assignable to type '(CaseReducer<GenericState<T>, { payload: any; type: string; }> | CaseReducerWithPrepare<GenericState<T>, PayloadAction<any, string, any, any>>) & (Reducers[string] extends { ...; } ? { ...; } : Reducers[string]) extends { ...; } ? { ...; } : (CaseReducer<...> | CaseReducerWithPrepare<...>) & (Reducers[string] extend...'.
Error: src/tests/createSlice.typetest.ts(436,15): error TS[7](https://github.com/reduxjs/redux-toolkit/actions/runs/3942178665/jobs/6745659661#step:9:8)006: Parameter 'state' implicitly has an 'any' type.
Error: src/tests/createSlice.typetest.ts(463,4[8](https://github.com/reduxjs/redux-toolkit/actions/runs/3942178665/jobs/6745659661#step:9:9)): error TS2345: Argument of type 'ActionCreatorWithoutPayload<`${string}/success`>' is not assignable to parameter of type 'ActionCreatorWithPayload<string, string>'.
  Types of property 'match' are incompatible.
    Type '(action: Action<unknown>) => action is { payload: undefined; type: `${string}/success`; }' is not assignable to type '(action: Action<unknown>) => action is { payload: string; type: string; }'.
      Type predicate 'action is { payload: undefined; type: `${string}/success`; }' is not assignable to 'action is { payload: string; type: string; }'.
        Type '{ payload: undefined; type: `${string}/success`; }' is not assignable to type '{ payload: string; type: string; }'.
          Types of property 'payload' are incompatible.
            Type 'undefined' is not assignable to type 'string'.

@Andarist Andarist closed this Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant