This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { select, put } from 'redux-sagas/effects'; | |
import { requestType, success } from './actions'; | |
import apiGenerator from './apiGenerator'; | |
function* fetchGlobalData({ | |
payload: { startDate } }) { | |
const api = yield select(apiGenerator); | |
const response = yield api.fetchHistoricalData(startDate); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { connect } from 'react-redux'; | |
import apiGenerator from './apiGenerator'; | |
function ComponentAPI({ | |
api | |
}) { | |
const [data, setData] = useState(null); | |
const [loading, setLoading] = useState(true); | |
useEffect(() => { |