This file contains hidden or 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 from 'react' | |
const MyComponent = 'div' | |
function App() { | |
return ( | |
<div> | |
<h1>Good Morning and Welcome to my Palace!</h1> | |
<hr /> | |
<MyComponent> |
This file contains hidden or 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 CombinedProviders = combineProviders( | |
SentryProvider, | |
NavbarProvider, | |
SidebarProvider, | |
FooterProvider, | |
BlogsProvider, | |
) | |
function App() { | |
return ( |
This file contains hidden or 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
function combineProviders(...providers) { | |
return ({ children }) => | |
providers.reduce( | |
(prev, CurrentProvider) => <CurrentProvider>{prev}</CurrentProvider>, | |
children, | |
) | |
} |
This file contains hidden or 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 { Provider } from 'react-redux' | |
import { ThemeProvider } from '@material-ui/core/styles/ThemeProvider' | |
import AppProvider from './components/AppProvider' | |
import NavbarProvider from './components/NavbarProvider' | |
import SidebarProvider from './components/SidebarProvider' | |
import FooterProvider from './components/FooterProvider' | |
import BlogsProvider from './components/BlogsProvider' | |
import SentryProvider from './components/SentryProvider' | |
import BlogsProvider from './components/BlogsProvider' | |
import store from '../app/store' |
This file contains hidden or 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
{ | |
"eslint disable line": { | |
"prefix": "eds", | |
"body": "// eslint-disable-line" | |
}, | |
"eslint disable next line": { | |
"prefix": "ednl", | |
"body": "// eslint-disable-next-line" | |
}, | |
"// @ts-ignore": { |
This file contains hidden or 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 { useReducer } from 'react' | |
const initialState = { | |
// | |
} | |
const reducer = (state, action) => { | |
switch (action.type) { | |
default: | |
return state |
This file contains hidden or 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
function createMyHigherOrderFunction(options) { | |
const state = { ...options } // Our local state object | |
return function(...args) { | |
return function(callback) { | |
return callback(state, ...args) | |
} | |
} | |
} |
This file contains hidden or 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 filteredFrogs = frogs | |
.filter((frog) => { | |
return frog.weight >= 8 | |
}) | |
.filter((frog) => { | |
return frog.gender === 'male' | |
}) | |
.filter((frog) => { | |
return frog.name.startsWith('b') | |
}) |