Skip to content

Instantly share code, notes, and snippets.

View jlei523's full-sized avatar

jlei523

  • San Francisco
View GitHub Profile
let cache = {};
class App extends React.Component {
static async getInitialProps({ req, query, asPath, pathname }) {
let data;
//if data is in cache then use the cache
if (cache[someID]) {
data = cache[someID]
} else {
class CashAmount {
constructor(amount) {
this.money = amount;
}
convertToPennies(amount) {
let amountString = amount + '';
let first = amountString.split('.')[0] * 100;
class CashAmount {
constructor(amount) {
this.money = amount;
}
convertToPennies(amount) {
let amountString = amount + '';
let first = amountString.split('.')[0] * 100;