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 { createContext } from 'react'; | |
import { useContext } from 'react'; | |
// local imports | |
import routes from './fuse-configs/routesConfig'; | |
/* Create Context */ | |
const AppContext = createContext({}); | |
/* Context Provider */ |
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 useSafeDispatch = dispatch => { | |
/* Figure out component is unmounted */ | |
const mountedRef = React.useRef(false) | |
/* this function going to be called as soon we mounted, without waiting the browser paint the screen */ | |
React.useLayoutEffect(() => { | |
mountedRef.current = true | |
/* called when as soon we unmounted without waiting the browser paint the screen */ | |
return () => { |
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 convertToSlug = (str) => { | |
return str | |
.toUpperCase() | |
.toLowerCase() | |
.trim() | |
.normalize('NFD') | |
.replace(/[^\w-]+/g, '') | |
.replace(/\s+/g, '-'); | |
}; |
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
{ | |
"arrowParens": "avoid", | |
"printWidth": 100, | |
"tabWidth": 2, | |
"useTabs": false, | |
"semi": true, | |
"singleQuote": true, | |
"trailingComma": "none", | |
"bracketSpacing": true, | |
"jsxBracketSameLine": true, |
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
{ | |
"editor.fontSize": 15, | |
"liveServer.settings.donotShowInfoMsg": true, | |
"editor.suggestSelection": "first", | |
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", | |
"vsintellicode.typescript.completionsEnabled": true, | |
"javascript.suggest.includeCompletionsForImportStatements": true, | |
"javascript.suggest.autoImports": true, | |
"terminal.integrated.defaultProfile.windows": "Git Bash", | |
"[javascript]": { |