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
/* @jsx createElement */ | |
import { createElement } from "@bikeshaving/crank/cjs"; | |
type EffectCleanup = undefined | (() => void); | |
function* useEffectInternal<F extends (...args: any[]) => EffectCleanup>( | |
effect: F | |
): Generator<void, void, Parameters<F>> { | |
let dependencies = yield; | |
let cleanup: EffectCleanup = effect(...dependencies); |
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
/* @jsx createElement */ | |
import { createElement } from "@bikeshaving/crank/cjs"; | |
function* useIntervalInternal(cb: () => void) { | |
// unfortunately pretty convoluted to deal with | |
// setup and teardown? You could probably implement | |
// the useState and useEffect APIs here tbh | |
let interval = undefined; | |
try { |
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
t.prefs_.set("background-color", "#1c1b19"); | |
t.prefs_.set("foreground-color", "#fce8c3"); | |
t.prefs_.set("cursor-color", "#fce8c3"); | |
t.prefs_.set("color-palette-overrides", ["#1c1b19","#ef2f27","#519f50","#fbb829","#2c78bf","#e02c6d","#0aaeb3","#918175","#2d2c29","#f75341","#98bc37","#fed06e","#68a8e4","#ff5c8f","#53fde9","#fce8c3"]); |