Skip to content

Commit

Permalink
feat(typescript): remove default typing for reducers and selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Pixeladed committed Oct 13, 2020
1 parent 4a88869 commit da1f098
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
21 changes: 3 additions & 18 deletions src/reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ import { getDefaultStatus } from './utils';
/**
* Handle async status updates for an async thunk pending action
*/
export const handlePending = <
Data,
Returned = unknown,
ThunkArg = unknown,
ThunkApiConfig extends {} = {}
>(
export const handlePending = <Data, Returned, ThunkArg, ThunkApiConfig>(
asyncThunk: AsyncThunk<Returned, ThunkArg, ThunkApiConfig>
) => (state: AsyncState<Data>) => {
const { typePrefix } = asyncThunk;
Expand All @@ -29,12 +24,7 @@ export const handlePending = <
/**
* Handle async status updates for an async thunk fulfilled action
*/
export const handleFulfilled = <
Data,
Returned = unknown,
ThunkArg = unknown,
ThunkApiConfig extends {} = {}
>(
export const handleFulfilled = <Data, Returned, ThunkArg, ThunkApiConfig>(
asyncThunk: AsyncThunk<Returned, ThunkArg, ThunkApiConfig>
) => (state: AsyncState<Data>) => {
const { typePrefix } = asyncThunk;
Expand All @@ -54,12 +44,7 @@ export const handleFulfilled = <
/**
* Handle async status updates for an async thunk rejected action
*/
export const handleRejected = <
Data,
Returned = unknown,
ThunkArg = unknown,
ThunkApiConfig extends {} = {}
>(
export const handleRejected = <Data, Returned, ThunkArg, ThunkApiConfig>(
asyncThunk: AsyncThunk<Returned, ThunkArg, ThunkApiConfig>
) => (
state: AsyncState<Data>,
Expand Down
7 changes: 1 addition & 6 deletions src/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ export const selectData = <Data>(state: AsyncState<Data>) => {
* @param state the async state to select the status from
* @param asyncThunk the async thunk created by createAsyncThunk
*/
export const selectStatus = <
Data,
Returned = unknown,
ThunkArg = unknown,
ThunkApiConfig extends {} = {}
>(
export const selectStatus = <Data, Returned, ThunkArg, ThunkApiConfig>(
state: AsyncState<Data>,
asyncThunk: AsyncThunk<Returned, ThunkArg, ThunkApiConfig>
) => {
Expand Down

0 comments on commit da1f098

Please sign in to comment.