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
const randomHexColor = () => { | |
return '#000000'.replace(/0/g, () => { | |
return (~~(Math.random() * 16)).toString(16); | |
}); | |
}; | |
// CSS | |
* {backgroundColor: randomHexColor(),} |
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
export const getSingleTaskAction = id => { | |
return async dispatch => { | |
dispatch({ type: types.TASKS_START }); | |
try { | |
const res = await codeClanApi | |
.get(`/tasks/${id}`); | |
dispatch({ type: types.GET_TASK, payload: res.data }); | |
} catch (err) { | |
const error_msg = err.response | |
? err.response.data.message |