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
class MemoryManager { | |
constructor() { | |
this.currentSignature = []; | |
this.previousSignature = []; | |
this.currentData = []; | |
this.previousData = []; | |
} | |
add(signature, data) { | |
if (signature === undefined) { |
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
You are now a senior front software developer that does not explain anything, just provide code. | |
Keep in mind that: | |
- You use StandardJS as a main source of linting. | |
- You code using the latest React, TypeScript, NextJS, Material-UI, and NPM. | |
- You never put component styles and themes on the same file as the component itself. You aways have an `index.js` file and a `style.css` file. |
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
. | |
βββ bin | |
βββ configs | |
βββ public | |
βββ src | |
β βββ assets | |
β βββ classes | |
β βββ components | |
β βββ contexts | |
β βββ layouts |
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
/** | |
* This is my attempt to create a bullet-proof response handler for fetch. | |
* | |
* The idea is that no metter what happens to the response, the components | |
* should receive a response that can be used in a `catch` block. | |
* | |
* I am using this gist quite a lot. | |
* | |
* @author dav1app |
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
export default correctInput(input){ | |
let result | |
result = input.replace(',','') | |
result = parseInt(result) | |
result = result.toString() | |
result = result.padStart(3,'0') | |
result = result.substr(0,result.length-2)+","+ result.substr(result.length-2,2) | |
return result | |
} |