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
/** | |
* Potential candidate for @types/polka. | |
*/ | |
// Type definitions for polka 1.0.0 | |
// Project: https://github.com/lukeed/polka | |
// Definitions by: Freek Zijlmans <https://github.com/frzi> | |
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | |
// TypeScript Version: 3.0 |
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
// Put me somewhere accessible. | |
const useForceUpdate = () => { | |
const [_, setState] = useState(0) | |
return () => setState(val => val + 1) | |
} | |
// Example. | |
const Component = () => { | |
const forceUpdate = useForceUpdate() |
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
// Fuck it. | |
private func makeString(prefix: String? = nil, values: [Any]) -> String { | |
var str = prefix ?? "" | |
for val in values { | |
str += "\(val) " | |
} | |
return str | |
} |
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
Show hidden characters
{ | |
"plugins": [ | |
["transform-react-jsx", { | |
"pragma": "document.createCustomElement" | |
}] | |
] | |
} |
NewerOlder