Description |
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 path = require('path'); | |
const dot = require(path.resolve(process.argv[2])); | |
const output = { | |
"type": "excalidraw", | |
"version": 2, | |
"source": "https://excalidraw.com", | |
"elements": [], |
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
// If the user has been on the page for over 12 hours, the next link | |
// click will do a full page transition to get new code | |
import React from "react"; | |
import { BrowserRouter, useLocation } from "react-router-dom"; | |
let hour = 3600000; | |
export default function StaleAppRouter(props) { | |
let [isStale, setIsStale] = useState(false); |
useSubscription
and useMutableSource
1 tearing and deopt behavior.
The tree below represents a React application mounting. During mount, two components read from an external, mutable source. The first one (List
) reads version 1 of that data and the second one (Item
) reads version 2.
N/A.
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 ec2 = require('@aws-cdk/aws-ec2'); | |
import ecs = require('@aws-cdk/aws-ecs'); | |
import elbv2 = require('@aws-cdk/aws-elasticloadbalancingv2'); | |
import cdk = require('@aws-cdk/core'); | |
class PublicFargateService extends cdk.Stack { | |
constructor(scope: cdk.App, id: string) { | |
super(scope, id); | |
// Create VPC and Fargate Cluster |
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
/** | |
* @flow | |
*/ | |
opaque type Ruleset = { [string]: string | number }; | |
type CreateInput = { | |
[styleName: string]: CSSProperties | |
}; |
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
/** | |
* @flow | |
*/ | |
import VisuallyHidden from "@reach/visually-hidden"; | |
import instyle from "instyle"; | |
import * as React from "react"; | |
import { Focus } from "react-events/focus"; | |
import { Drag } from "react-events/drag"; | |
import { Press } from "react-events/press"; |
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 {useCallback, useEffect, useReducer, useRef} = require('react'); | |
let effectCapture = null; | |
exports.useReducerWithEmitEffect = function(reducer, initialArg, init) { | |
let updateCounter = useRef(0); | |
let wrappedReducer = useCallback(function(oldWrappedState, action) { | |
effectCapture = []; | |
try { | |
let newState = reducer(oldWrappedState.state, action.action); |
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
function h (tagName, attributes = {}, children = []) { | |
return { | |
tagName, | |
attributes, | |
children, | |
}; | |
} | |
function diffAttrs (element, attributes) { | |
const newAttrs = Object.keys(attributes); |
NewerOlder