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 { globalStyle, GlobalStyleRule } from "@vanilla-extract/css"; | |
| interface RecursiveGlobalStyle { | |
| [k: string]: GlobalStyleRule | RecursiveGlobalStyle; | |
| } | |
| function globalUtil(selector: string, styles: RecursiveGlobalStyle) { | |
| const write = ( | |
| key: string[], | |
| value: RecursiveGlobalStyle | GlobalStyleRule |
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"; | |
| import { Link } from "react-router-dom"; | |
| export function createResource(getPromise) { | |
| let cache = {}; | |
| let inflight = {}; | |
| function load(key) { | |
| inflight[key] = getPromise(key).then(val => { | |
| delete inflight[key]; |
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' | |
| interface Props { | |
| children: React.ReactElement<any> | |
| once?: boolean | |
| onReveal: () => void | |
| options?: { [key: string]: any } | |
| } | |
| export const Reveal = ({ children, once = false, onReveal, options = {} }: Props) => { |
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'; | |
| import PropTypes from 'prop-types'; | |
| SomeUi.propTypes = { | |
| propA: PropTypes.string.isRequired, | |
| propB: PropTypes.string | |
| }; | |
| SomeUi.defaultProps = { | |
| propB: "a default" |
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
| {- Routes.elm -} | |
| type Route = Home | |
| | About | |
| | Posts String | |
| | Contact | |
| routeToString : Route -> String | |
| routeToString route = | |
| let | |
| pieces = |