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 fetch = new Effect(); | |
function double() { | |
const x = fetch.throw("number"); | |
return x * 2 | |
} | |
try { | |
double() | |
} fetch.catch(resume, ...args) { |
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 default function useClickOutside(onClickOutside, exempt = []) { | |
const container = React.useRef(null); | |
const mouseDownTargetIsOutside = React.useRef(false); | |
React.useEffect(() => { | |
/* if the click event doesnt start outside of the element then we want to ignore it */ | |
/* imagine if someone clicked while swiping the cursor, if it started inside, then they probably */ | |
/* wouldn't expect mouseup to fire like it was outside */ |
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 numbers = [ | |
38, | |
54, | |
68, | |
93, | |
72, | |
12, | |
33, | |
8, | |
98, |
OlderNewer