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
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 { |
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
class CashAmount { | |
constructor(amount) { | |
this.money = amount; | |
} | |
convertToPennies(amount) { | |
let amountString = amount + ''; | |
let first = amountString.split('.')[0] * 100; |
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
class CashAmount { | |
constructor(amount) { | |
this.money = amount; | |
} | |
convertToPennies(amount) { | |
let amountString = amount + ''; | |
let first = amountString.split('.')[0] * 100; |
NewerOlder