Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.

Commit 9fd92ab

Browse files
committed
update #37, update any
1 parent c3dd706 commit 9fd92ab

File tree

6 files changed

+10
-7
lines changed

6 files changed

+10
-7
lines changed

app/containers/App/actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { action } from 'typesafe-actions';
2-
// import {} from './types';
32

43
import ActionTypes from './constants';
4+
import { Repo } from '../RepoListItem/types';
55

66
export const loadRepos = () => action(ActionTypes.LOAD_REPOS);
7-
export const reposLoaded = (repos: any[], username: string) =>
7+
export const reposLoaded = (repos: Repo[], username: string) =>
88
action(ActionTypes.LOAD_REPOS_SUCCESS, { repos: repos, username: username });
99
export const repoLoadingError = (error: object) =>
1010
action(ActionTypes.LOAD_REPOS_ERROR, error);

app/containers/App/tests/actions.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import ActionTypes from '../constants';
22

33
import { loadRepos, reposLoaded, repoLoadingError } from '../actions';
44
import { action } from 'typesafe-actions';
5+
import { Repo } from '../../RepoListItem/types';
56

67
describe('App Actions', () => {
78
describe('loadRepos', () => {
@@ -16,7 +17,7 @@ describe('App Actions', () => {
1617

1718
describe('reposLoaded', () => {
1819
it('should return the correct type and the passed repos', () => {
19-
const fixture = ['Test'];
20+
const fixture = [{}] as Repo[];
2021
const username = 'test';
2122
const expectedResult = action(
2223
ActionTypes.LOAD_REPOS_SUCCESS,

app/containers/App/tests/reducer.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import appReducer from '../reducer';
22
import { loadRepos, reposLoaded, repoLoadingError } from '../actions';
33
import { ContainerState } from '../types';
4+
import { Repo } from '../../RepoListItem/types';
45

56
describe('appReducer', () => {
67
let state: ContainerState;
@@ -37,7 +38,7 @@ describe('appReducer', () => {
3738
{
3839
name: 'My Repo',
3940
},
40-
];
41+
] as Repo[];
4142
const username = 'test';
4243
const expectedResult = {
4344
currentUser: username,

app/containers/HomePage/tests/saga.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import ActionTypes from 'containers/App/constants';
88
import { reposLoaded, repoLoadingError } from 'containers/App/actions';
99

1010
import githubData, { getRepos } from '../saga';
11+
import { Repo } from '../../RepoListItem/types';
1112

1213
const username = 'mxstbr';
1314

@@ -34,7 +35,7 @@ describe('getRepos Saga', () => {
3435
{
3536
name: 'Second repo',
3637
},
37-
];
38+
] as Repo[];
3839
const putDescriptor = getReposGenerator.next(response).value;
3940
expect(putDescriptor).toEqual(put(reposLoaded(response, username)));
4041
});

app/utils/injectSaga.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default function hocWithSaga<P>({ key, saga, mode }: InjectSagaParams) {
2626
public static WrappedComponent = WrappedComponent;
2727

2828
// public static contextType = ReactReduxContext;
29-
public injectors: any;
29+
public injectors: ReturnType<typeof getInjectors>;
3030

3131
public static displayName = `withSaga(${WrappedComponent.displayName ||
3232
WrappedComponent.name ||

app/utils/loadable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const loadable = <T extends React.ComponentType<any>>(
99
) => {
1010
const LazyComponent = lazy(importFunc);
1111

12-
return (props: any) => (
12+
return (props: React.ComponentProps<T>): JSX.Element => (
1313
<Suspense fallback={fallback}>
1414
<LazyComponent {...props} />
1515
</Suspense>

0 commit comments

Comments
 (0)