Kris YotamAlpha Typix Build1671cae2 years agoHistory
21 lines · 645 B · TypeScript
RawDownload
import { setTimerId, setWordList, timerSet } from "store/actions";import { store } from "store/store"; export const resetTest = async () => {    const { dispatch, getState } = store;    const {        time: { timerId },        preferences: { timeLimit, type },    } = getState();    document        .querySelectorAll(".wrong, .right")        .forEach((el) => el.classList.remove("wrong", "right"));    if (timerId) {        clearInterval(timerId);        dispatch(setTimerId(null));    }    import(`wordlists/${type}.json`).then((words) =>        dispatch(setWordList(words.default))    );    dispatch(timerSet(timeLimit));};