part4
Tony Fages 1 year ago
parent 83196ed2be
commit e122ae186c

@ -9,7 +9,8 @@ const reducer = {
// @ts-ignore // @ts-ignore
const store = configureStore({ const store = configureStore({
reducer: reducer, // @ts-ignore
reducer,
middleware: (getDefaultMiddleware) => middleware: (getDefaultMiddleware) =>
getDefaultMiddleware({ getDefaultMiddleware({
serializableCheck: false serializableCheck: false

@ -21,11 +21,13 @@ export function AccueilScreen() {
useEffect(() => { useEffect(() => {
const getJokes = async () => { const getJokes = async () => {
// @ts-ignore
dispatch(setRecentJokes(await getLatestJokes())); dispatch(setRecentJokes(await getLatestJokes()));
}; };
getJokes(); getJokes();
const getTopCategories = async () => { const getTopCategories = async () => {
// @ts-ignore
dispatch(setCategories(await getCategorie())); dispatch(setCategories(await getCategorie()));
}; };
getTopCategories(); getTopCategories();

@ -13,6 +13,7 @@ export function ListJokeScreen() {
const dispatch = useDispatch(); const dispatch = useDispatch();
useEffect(() => { useEffect(() => {
const getJokes = async () => { const getJokes = async () => {
// @ts-ignore
dispatch(setSample(await getSampleJoke())); dispatch(setSample(await getSampleJoke()));
}; };
getJokes(); getJokes();

Loading…
Cancel
Save