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'; | |
| export class ErrorBoundary extends React.Component { | |
| state = { hasError: false, error: null }; | |
| static getDerivedStateFromError(error) { | |
| return { hasError: true, error }; | |
| } | |
| componentDidCatch(error, errorInfo) { |
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
| Project dewcription and demo. https://www.loom.com/share/03cfd87b3a4c4f8d85e300439a83383c | |
| Technical concepts. https://www.loom.com/share/87ea5041c9db43eda1e2a9a38833f7dc | |
| What has excited me. https://www.loom.com/share/a15536307fe04f18bfd9cf37dfe66fda |
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 Stack = function () { | |
| this.count = 0; | |
| this.storage = {}; | |
| }; | |
| Stack.prototype.push = function (element) { | |
| this.storage[this.count] = element; | |
| this.count++; | |
| }; |
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
| self.addEventListener('install', function(event) { | |
| event.waitUntil( | |
| // TODO: change the site's theme, eg swap the vars in public/scss/_theme.scss | |
| // Ensure at least $primary-color changes | |
| // TODO: change cache name to 'wittr-static-v2' | |
| caches.open('wittr-static-v2').then(function(cache) { | |
| return cache.addAll([ | |
| '/', | |
| 'js/main.js', | |
| 'css/main.css', |