Skip to content

Commit 9c7ac4e

Browse files
author
Justin Krueger
committed
Add a descriptive comment for the esoteric tuple
1 parent 735a7ab commit 9c7ac4e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/createSlice.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import { createSliceSelector, createSelectorName } from './sliceSelector'
55

66
/**
77
* An action creator atttached to a slice.
8+
*
9+
* The `P` generic is wrapped with a single-element tuple to prevent the
10+
* conditional from being checked distributively, thus preserving unions
11+
* of contra-variant types.
812
*/
913
export type SliceActionCreator<P> = [P] extends [void]
1014
? () => PayloadAction<void>

0 commit comments

Comments
 (0)