Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
fix: Explicitly set types to avoid TS7057
Browse files Browse the repository at this point in the history
  • Loading branch information
hangy committed May 10, 2021
1 parent f5a8757 commit 3807705
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
17 changes: 13 additions & 4 deletions src/pages/create/createSaga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ import { IState } from "../../reducer";
import { CardSetServiceId, ICardSetService } from "../../services/cardSets";
import { Services } from "../../services/services";
import { ISessionService, SessionServiceId } from "../../services/sessions";
import { ITeamService, TeamServiceId } from "../../services/teams";
import {
IIteration,
ITeam,
ITeamService,
TeamServiceId
} from "../../services/teams";
import { loadSessions } from "../home/sessionsActions";
import * as Actions from "./createActions";
import { IIdentityService, IdentityServiceId } from "../../services/identity";
import { ICardSet } from "../../model/cards";

export function* createSaga() {
yield all([initSaga(), iterationSaga(), createSessionSaga()]);
Expand All @@ -37,7 +43,7 @@ export function* loadTeams() {

// TODO: Get source from state?
const teamService = Services.getService<ITeamService>(TeamServiceId);
const teams = yield call(
const teams: ITeam[] = yield call(
[teamService, teamService.getAllTeams],
projectInfo.id
);
Expand All @@ -48,7 +54,10 @@ export function* loadTeams() {
export function* loadCardSets() {
const cardSetService =
Services.getService<ICardSetService>(CardSetServiceId);
const cardSets = yield call([cardSetService, cardSetService.getSets]);
const cardSets: ICardSet[] = yield call([
cardSetService,
cardSetService.getSets
]);
yield put(Actions.setCardSets(cardSets));
}

Expand All @@ -58,7 +67,7 @@ export function* iterationSaga() {
);

const teamService = Services.getService<ITeamService>(TeamServiceId);
const iterations = yield call(
const iterations: IIteration[] = yield call(
[teamService, teamService.getIterationsForTeam],
action.payload
);
Expand Down
4 changes: 2 additions & 2 deletions src/pages/session/channelSaga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
take,
takeEvery
} from "redux-saga/effects";
import { Action } from "typescript-fsa";
import { Action, AnyAction } from "typescript-fsa";
import { ISession } from "../../model/session";
import { ISnapshot } from "../../model/snapshots";
import { IChannel } from "../../services/channels/channels";
Expand Down Expand Up @@ -87,7 +87,7 @@ export function* channelSenderSaga(sessionId: string, channel: IChannel) {
export function* channelListenerSaga(channel: IChannel) {
const subscription: Channel<{}> = yield call(subscribe, channel);
while (true) {
const action = yield take(subscription);
const action: AnyAction = yield take(subscription);

switch (action.type) {
case userJoined.type: {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/session/sessionSaga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ export function* sessionSaga(action: ReturnType<typeof loadSession>) {
})
);

const estimationTask = yield fork(sessionEstimationSaga);
const notificationTask = yield fork(notificationSaga);
const estimationTask: Task = yield fork(sessionEstimationSaga);
const notificationTask: Task = yield fork(notificationSaga);

// Wait for leave or end
const a:
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
"jsx": "react-jsx"
},
"include": ["src"]
}

0 comments on commit 3807705

Please sign in to comment.