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
async function refresh() { | |
setLoading(true) | |
let items = [array of ids] | |
// getItem is an external, asynchronous call | |
const call = async itemId => { | |
return getItem({ id: itemId }) | |
} | |
// the key here is the 'Promise.all' |
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
REACT_APP_VERSION=$npm_package_version | |
REACT_APP_NAME=$npm_package_name |
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, { useEffect, useRef, useState } from 'react' | |
import { makeStyles } from '@material-ui/core/styles' | |
import AccountCircle from '@material-ui/icons/AccountCircle' | |
import ExpandMoreIcon from '@material-ui/icons/ExpandMore' | |
import FavoriteIcon from '@material-ui/icons/Favorite' | |
import LocationOnIcon from '@material-ui/icons/LocationOn' | |
import MenuIcon from '@material-ui/icons/Menu' | |
import RestoreIcon from '@material-ui/icons/Restore' | |
import { | |
AppBar, |
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 from 'react' | |
const App = () => { | |
return ( | |
<React.Fragment> | |
<h1>App</h1> | |
</React.Fragment> | |
) | |
} |
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, { Component } from 'react' | |
class Foo extends Component { | |
componentDidMount() { | |
// startup code here | |
} | |
componentWillUnmount() { | |
// cleanup code here | |
} |
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 from 'react' | |
import { useCookies } from 'react-cookie' | |
import LoginPage from './login-page' | |
import { | |
firebaseAuth, | |
facebookProvider, | |
githubProvider, | |
googleProvider, |
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, { useEffect, useState } from 'react' | |
const App = () => { | |
const url = 'https://jsonplaceholder.typicode.com/todos/1' | |
const options = { | |
method: 'GET', | |
headers: { | |
'Content-Type': 'application/json', | |
'Accept': 'application/json' | |
}, |
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
// With rrule & Moment libraries | |
import React from 'react' | |
import moment from 'moment' | |
import { RRule } from 'rrule' | |
function App() { | |
const today = new Date(moment.utc().format()) | |
const yesterday = new Date( | |
moment | |
.utc() |
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 jwt = require("jsonwebtoken") | |
const jwt_secret = "42737800" | |
let user = { | |
id: "1234", | |
tenant: "3214", | |
role: "owner", | |
} | |
console.log("user", user) |
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
{"lastUpload":"2020-06-19T20:01:34.921Z","extensionVersion":"v3.4.3"} |
OlderNewer