I have a file called static.js where I define all generator functions:
For example:
export function* getSettings() {
try {
const settings: Array<SettingElement> = yield callHttp(get, GET_SETTINGS);
yield put(setSettings(settings));
}
} catch (err: any) {
yield put(openErrorSnack(err.message));
}
}
export function* getSocialLinks() {
try {
const social: Array<SocialElement> = yield callHttp(get, GET_SOCIAL);
yield put(setSocialLinks(social));
} catch (err: any) {
yield put(openErrorSnack(err.message));
}
}
In another file named index.ts, I aim to bring in all the aforementioned sagas.
import * as staticSagas from './static';
What would be the best way to create a type or interface for these imported sagas?
Your assistance is greatly appreciated. Thank you!