Skip to content

Instantly share code, notes, and snippets.

View oxenprogrammer's full-sized avatar
Continuous Learning

Emanuel Okello oxenprogrammer

Continuous Learning
View GitHub Profile
@oxenprogrammer
oxenprogrammer / ErrorBoundary.js
Created August 27, 2021 16:04
React Suspense
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) {
@oxenprogrammer
oxenprogrammer / links.txt
Last active July 19, 2021 22:19
List of Videos for React Capstone Project.
const Stack = function () {
this.count = 0;
this.storage = {};
};
Stack.prototype.push = function (element) {
this.storage[this.count] = element;
this.count++;
};
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',