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
/** | |
* Timer class for count-down and count-up | |
*/ | |
class Timer { | |
constructor (duration = 0, countDown = true, step = 1) { | |
this.duration = duration; | |
this.countDown = countDown; | |
this.step = step; | |
this.opr = countDown ? -1 : 1; | |
this.currentTime = this.freshCurrentTime; |
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, {createContext, useReducer} from 'react'; | |
import initialState from "./initialState"; | |
import reducer from "./reducer"; | |
import useActions from "./useActions"; | |
export const UserContext = createContext(); | |
export const UserProvider = ({children}) => { | |
const value = {user: null}; |
OlderNewer