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
/** | |
* Modified by Russell Dempsey on 2021 DEC 15 | |
* @see https://stackoverflow.com/a/62002044/592760 | |
*/ | |
type Subscriber<T> = (value: T) => void; | |
class Observable<T> { | |
private subscribers = new Set<Subscriber<T>>(); | |
constructor(private value: T) {} |
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
// TODO: make `pages` optional and measure the div when unspecified, this will | |
// allow more normal document flow and make it easier to do both mobile and | |
// desktop. | |
import { | |
createContext, | |
useCallback, | |
useContext, | |
useEffect, | |
useMemo, | |
useRef, |