Skip to content

Commit

Permalink
Adding ts fix recommended by reduxjs/redux-thunk#333
Browse files Browse the repository at this point in the history
  • Loading branch information
jomaora committed Jul 21, 2022
1 parent b331047 commit f28ec30
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/@coorpacademy-app-review/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {useEffect, useState} from 'react';
import type {} from 'redux-thunk/extend-redux'; // https://github.com/reduxjs/redux-thunk/issues/333
import {AnyAction, Store} from 'redux';
import {connect, Provider} from 'react-redux';
import AppReviewTemplate from '@coorpacademy/components/es/template/app-review';
Expand All @@ -20,9 +21,8 @@ import {updateFinishedSlides} from './actions/ui/finished-slides';
import {updateReviewStatus} from './actions/ui/review-status';
import {updateStepItemsOnValidation, updateStepItemsOnNext} from './actions/ui/step-items';
import {fetchSkills} from './actions/api/fetch-skills';
import {postProgression, PostProgressionAction} from './actions/api/post-progression';
import {postProgression} from './actions/api/post-progression';
import {VIEWS} from './common';
import {FetchSlideAction} from './actions/api/fetch-slide';

// -----------------------------------------------------------------------------

Expand Down Expand Up @@ -154,6 +154,8 @@ const AppReview = ({options}: {options: AppOptions}): JSX.Element | null => {
if (store === null) return;

const {skillRef, token} = options;
// ThunkAction is not assignable to parameter of type 'AnyAction'
// ts problem describre here = https://github.com/reduxjs/redux-thunk/issues/333
skillRef
? store.dispatch(postProgression(skillRef, token))
: store.dispatch(fetchSkills(token));
Expand Down

0 comments on commit f28ec30

Please sign in to comment.