Last active
February 14, 2019 21:06
-
-
Save ratbeard/417708d25621c266fe669bb4c10c9cef to your computer and use it in GitHub Desktop.
So many options in life…
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
// X) | |
it('JUST works', () => { | |
let result = appendQueryParams('rat.com', { a: 1, b: 'cool' }) | |
expect(result).toEqual('rat.com?a=1&b=cool') | |
]) | |
// Y) | |
it('JUST works', () => { | |
expect( | |
appendQueryParams('rat.com', { a: 1, b: 'cool' }) | |
).toEqual('rat.com?a=1&b=cool') | |
]) | |
// Mike sez: X is slightly more akward w/ multiple results in a block (only 1st one has let), but is preffered. |
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
// (Z) | |
export function SubmitButton({ onClick, branding, disabled }: { | |
branding: Branding, | |
disabled: boolean; | |
onClick: () => void, | |
}) { | |
return <button /> | |
} | |
// (ZZ) | |
interface Props { | |
branding: Branding; | |
disabled: boolean; | |
onClick: () => void; | |
} | |
export function SubmitButton({ onClick, branding, disabled }: Props) { | |
return <button /> | |
} | |
// Mike sez: pref the readability of the second, but hovering over the type in vscode doesn't show the prop types, just | |
// `function SubmitButton({ onClick, branding, disabled }: Props): JSX.Element`. | |
// Need to cmd+click in to it, or start typing and let it tell you what you're missing. |
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
A) | |
<Header | |
branding={branding} | |
title={title} | |
timer={timer} | |
/> | |
B) | |
<Header {...{ branding, title, timer }} /> | |
// Not a strong pref here, B is a lil odd but maybe prefered |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment