View files.js
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
const CODE_APP = ` | |
// This is the root component in | |
// the React application. | |
import Header from '../Header'; | |
import Widget from '../Widget'; | |
function App() { | |
return ( | |
<> | |
<Header title="My Application" /> |
View Form Submit.js
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
window.addEventListener( "load", function () { | |
function sendData() { | |
const XHR = new XMLHttpRequest(); | |
// Bind the FormData object and the form element | |
const FD = new FormData( form ); | |
// Define what happens on successful data submission | |
XHR.addEventListener( "load", function(event) { | |
alert( event.target.responseText ); |
View TaskRunner.js
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
// Task Runner | |
// Implement Asynchronous Task Runner | |
// tasks execute in an order of priority | |
// If the task runner have bandwidth it will pick immediately | |
// A "TaskRunner" Constructor takes one argument, "concurrency", and exposes one method "push" on its prototype. | |
// The "push" method takes two arguments. First one is task which is a "function" & second argument priority number | |
class TaskRunner { |
View runtimeCaching.js
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
"use strict"; | |
module.exports = [ | |
{ | |
urlPattern: /^https:\/\/fonts\.(?:googleapis|gstatic)\.com\/.*/i, | |
handler: "CacheFirst", | |
options: { | |
cacheName: "google-fonts", | |
expiration: { | |
maxEntries: 4, |